Home Analyst Portal

Required field question

alex_kokinalex_kokin Member IT Monkey ✭

Is there a way to make all these fields in the RCA tab REQUIRED only if PI is select in the IMPACT


Best Answers

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Answer ✓

    @alex_kokin

    Maybe but would need to test. You can provide an expression for the value of Required.

    So on the RCA controls, you could try

    Required: pageform.viewModel.Impact.Text === 'PI'
    

    Don't know if it will work though and to be honest, pretty doubtful it will update dynamically if you change the Impact. It might well work after a save though.

    I'll have a play a bit later but if you want to try and come back. If not, you'll have to use some JS bound to the change event of the Impact drop down.

    Geoff

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Answer ✓

    It does work, but as expected, only takes effect on next page load. So if you change Impact to 'PI' then click Apply, then the RCA fields will be required.

Answers

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Answer ✓

    @alex_kokin

    Maybe but would need to test. You can provide an expression for the value of Required.

    So on the RCA controls, you could try

    Required: pageform.viewModel.Impact.Text === 'PI'
    

    Don't know if it will work though and to be honest, pretty doubtful it will update dynamically if you change the Impact. It might well work after a save though.

    I'll have a play a bit later but if you want to try and come back. If not, you'll have to use some JS bound to the change event of the Impact drop down.

    Geoff

  • alex_kokinalex_kokin Member IT Monkey ✭

    I assume I place that on each line that I need to be required?

  • alex_kokinalex_kokin Member IT Monkey ✭

    Can you show me please.


    /*********/

    /** TAB **/

    /*********/

    {

          name: "RCA",

          content: [

            {

              customFieldGroupList: [

                {

                  name: "RCA",

                  rows:[

                    {

                      columnFieldList: [

                         

    { DataType: "Boolean", PropertyDisplayName: "WAS INCIDENT RELATED TO A RELEASE", PropertyName: "ReleaseProperty", Inline: true,},

                        { DataType: "String", PropertyDisplayName: "ISSUE", PropertyName: "RCA_ISSUE",},

    { DataType: "String", PropertyDisplayName: "IMPACT", PropertyName: "RCA_IMPACT",},

    { DataType: "Enum", PropertyDisplayName: "AFFECTED SYSTEMS", PropertyName: "Affected Systems", EnumId: 'e4ee206c-a502-fdab-ecb2-e0b042936aeb'},

    { DataType: "DateTime", PropertyDisplayName: "START", PropertyName: "RCA_Start",},

    { DataType: "DateTime", PropertyDisplayName: "STOP", PropertyName: "RCA_End",},

    { DataType: "Enum", PropertyDisplayName: "CAUSE", PropertyName: "RCA_CAUSE", EnumId: '9f19b929-0a53-4e88-8c44-b5ce34b8832a'},

    { DataType: "LongString", PropertyDisplayName: "CAUSE DETAILS", PropertyName: "RCACAUSEDETAILS", MinLength: 0, MaxLength: 4000 },

    { DataType: "LongString", PropertyDisplayName: "RESOLVED", PropertyName: "RCA_RESOLVED", MinLength: 0, MaxLength: 4000 },

    { DataType: "LongString", PropertyDisplayName: "NEXTSTEPS", PropertyName: "RCA_NEXTSTEP",MinLength: 0, MaxLength: 4000},

    { DataType: "LongString", PropertyDisplayName: "ADO LINKS", PropertyName: "ADO_Links",MinLength: 0, MaxLength: 4000}

                      ],

                    }

                  ]

                },

    {

                  name: "FileAttachments",

                  type: "fileAttachmentsDragDrop"

                },

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    edited June 2021

    @alex_kokin

      { DataType: "String", PropertyDisplayName: "ISSUE", PropertyName: "RCA_ISSUE", Required: pageForm.viewModel.Impact.Name === 'PI'},
    
  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    I'm testing now myself

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Answer ✓

    It does work, but as expected, only takes effect on next page load. So if you change Impact to 'PI' then click Apply, then the RCA fields will be required.

  • alex_kokinalex_kokin Member IT Monkey ✭

    @Geoff_Ross Thank you very much!

  • alex_kokinalex_kokin Member IT Monkey ✭

    @Geoff_Ross

    I have this query to give me all incident data however I have two issues in it. I need the TierQueue (Support Group) field to show the actual names and I need the Classification to show the full path.

    The query is here in two parts.

    select

            INC.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C              as [ID]

     , INC.TierQueue_1E9615C2_3386_2452_BA83_05B2169DF38C          as [Support Group]

     , Classification.LTValue                        as [Classification]

     , AffectedUser.DisplayName                       as [Affected User]

           , AffectedUser.Company_8CD345AC_E9BC_E5FE_88BA_D281FC29637D       as [Copmany]

           , AssignedToUser.DisplayName                      as [Assigned To]

           , AssignedToUser.UserName_6AF77E23_669B_123F_B392_323C17097BBD     as [Assigned To Username]

           , INC.ContactMethod_28FB7672_2975_24DE_8340_B4333DEC82C8        as [Alternative Contact]

           , ParentInc.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C           as [Parent Incident]

           , LastModified.LastModified                       as [Last Modified]

           , INC.ResolvedDate_D2A4C73F_01B8_29C5_895B_5BE4C3DFAC4E         as [Resolved Date]

           , INC.DisplayName                            as [Displayname]

           , INC.ClosedDate_C529833E_0926_F082_C185_294CBC8BB9FD          as [ClosedDate]

           , INC.CreatedDate_6258638D_B885_AB3C_E316_D00782B8F688         as [CreatedDate]

           , INC.FirstResponseDate_3FB895CE_EC1D_7011_C099_25AC8F22469A      as [First Responce Date]

           , INC.Description_59B77FD5_FE0E_D2B5_D541_0EBBD1EC9A2B         as [Description]

           , INC.FirstAssignedDate_4C9FBB15_6DF5_E42E_FD6D_18F416428495      as [FirstAssignedDate]

           , INC.Priority_B930B964_A1C4_0B5A_B2D1_BFBE9ECDC794           as [Priority]

           , INC.ResolutionDescription_85E8B5FA_3ECB_9B6C_0A02_A8C9EC085A39    as [ResolutionDescription]

           , INC.ResolvedDate_D2A4C73F_01B8_29C5_895B_5BE4C3DFAC4E         as [ResolvedDate]

           , INC.Title_9691DD10_7211_C835_E3E7_6B38AF8B8104            as [Title]

           , Status.LTValue                            as [Status]

           , Impact.LTValue                            as [Impact]

           , Urgency.LTValue                            as [Urgency]

           , INC.FirstResponseDate_3FB895CE_EC1D_7011_C099_25AC8F22469A      as [First_Response_Date ]

           , Source.LTValue                            as [Source]

           , INC.Escalated_525F1F92_CEB3_079D_C0A5_E7A06AC4D6A5          as [Escalated]

  • alex_kokinalex_kokin Member IT Monkey ✭

    @Geoff_Ross


    from

            MTV_System$WorkItem$Incident as INC

            /*Get Affected User*/

            left outer Join

                    (

                          select

                               rel1.SourceEntityId

                              , Users.DisplayName

                              , Users.UserName_6AF77E23_669B_123F_B392_323C17097BBD

                              , Users.Company_8CD345AC_E9BC_E5FE_88BA_D281FC29637D

                          from

                               MTV_System$Domain$User as Users

                               inner join

                                     Relationship as rel1

                                     on

                                          Users.BaseManagedEntityID=Rel1.TargetEntityId

                          where

                               rel1.RelationshipTypeId= 'DFF9BE66-38B0-B6D6-6144-A412A3EBD4CE'

                               and rel1.IsDeleted   = '0'

                    )

                    as AffectedUser

                    on

                            affectedUser.SourceEntityId=INC.BaseManagedEntityId

            /*Get Assigned To User*/

            left outer Join

                    (

                          select

                               rel1.SourceEntityId

                              , Users.DisplayName

                              , Users.UserName_6AF77E23_669B_123F_B392_323C17097BBD

                          from

                               MTV_System$Domain$User as Users

                               inner join

                                     Relationship as rel1

                                     on

                                          Users.BaseManagedEntityID=Rel1.TargetEntityId

                          where

                               rel1.RelationshipTypeId= '15E577A3-6BF9-6713-4EAC-BA5A5B7C4722'

                               and rel1.IsDeleted   = '0'

                    )

                    as AssignedToUser

                    on

                            AssignedToUser.SourceEntityId=INC.BaseManagedEntityId

            /*Get Parent incident*/

            left outer Join

                    (

                          select

                               rel1.SourceEntityId

                              , INCS.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C

                          from

                               MTV_System$WorkItem$Incident as INCS

                               inner join

                                     Relationship as rel1

                                     on

                                          INCS .BaseManagedEntityID=Rel1.TargetEntityId

                          where

                               rel1.RelationshipTypeId= 'DA3123D1-2B52-A281-6F42-33D0C1F06AB4'

                               and rel1.IsDeleted   = '0'

                    )

                    as ParentInc

                    on

                            ParentInc.SourceEntityId=INC.BaseManagedEntityId

            /* Get Last Modified*/

            left outer join

                    (

                          SELECT

                               t2.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C

                              , t1.LastModified

                          FROM

                               dbo.MTV_System$WorkItem$Incident AS t2

                               INNER JOIN

                                     (

                                             SELECT

                                                     MT_System$WorkItem$Incident_Log.EntityChangeLogId

                                                    , inc.BaseManagedEntityId

                                                    , ecl.LastModified

                                             FROM

                                                     dbo.MT_System$WorkItem$Incident_Log

                                                     INNER JOIN

                                                             MT_System$WorkItem$Incident AS INC

                                                             ON

                                                                     INC.BaseManagedEntityId = dbo.MT_System$WorkItem$Incident_Log.BaseManagedEntityId

                                                     LEFT OUTER JOIN

                                                             dbo.EntityChangeLog AS ecl

                                                             ON

                                                                     ecl.EntityChangeLogId = MT_System$WorkItem$Incident_Log.EntityChangeLogId

                                             UNION

                                             SELECT

                                                     SLALog.EntityChangeLogId

                                                    , inc.BaseManagedEntityId

                                                    , EntityChangeLog.LastModified

                                             FROM

                                                     dbo.MTV_System$WorkItem$Incident AS inc

                                                     LEFT OUTER JOIN

                                                             dbo.Relationship AS rel

                                                             ON

                                                                     rel.SourceEntityId = inc.BaseManagedEntityId

                                                     LEFT OUTER JOIN

                                                             dbo.MT_System$SLA$Instance$TimeInformation_Log AS SLALog

                                                             ON

                                                                     SLALog.BaseManagedEntityId = rel.TargetEntityId


                                                     LEFT OUTER JOIN

                                                             EntityChangeLog

                                                             ON

                                                                     SLALog.EntityChangeLogId = EntityChangeLog.EntityChangeLogId

                                             WHERE

                                                     (

                                                             rel.RelationshipTypeId = 'BA08F9BB-85C7-20D8-05E3-0035938CDDD5'

                                                     )

                                     )

                                     AS t1

                                     ON

                                          t1.BaseManagedEntityId = t2.BaseManagedEntityId

                                          AND t1.LastModified  =

                                          (

                                              SELECT

                                                 MAX(LastModified) AS Expr1

                                              FROM

                                                 (

                                                         SELECT

                                                                 MT_System$WorkItem$Incident_Log.EntityChangeLogId

                                                                , inc.BaseManagedEntityId

                                                                , ecl.LastModified

                                                         FROM

                                                                 dbo.MT_System$WorkItem$Incident_Log

                                                                 INNER JOIN

                                                                         MT_System$WorkItem$Incident AS INC

                                                                         ON

                                                                                 INC.BaseManagedEntityId = dbo.MT_System$WorkItem$Incident_Log.BaseManagedEntityId

                                                                 LEFT OUTER JOIN

                                                                         dbo.EntityChangeLog AS ecl

                                                                         ON

                                                                                 ecl.EntityChangeLogId = MT_System$WorkItem$Incident_Log.EntityChangeLogId

                                                         UNION

                                                         SELECT

                                                                 SLALog.EntityChangeLogId

                                                                , inc.BaseManagedEntityId

                                                                , EntityChangeLog.LastModified

                                                         FROM

                                                                 dbo.MTV_System$WorkItem$Incident AS inc

                                                                 LEFT OUTER JOIN

                                                                         dbo.Relationship AS rel

                                                                         ON

                                                                                 rel.SourceEntityId = inc.BaseManagedEntityId

                                                                 LEFT OUTER JOIN

                                                                         dbo.MT_System$SLA$Instance$TimeInformation_Log AS SLALog

                                                                         ON

                                                                                 SLALog.BaseManagedEntityId = rel.TargetEntityId

                                                                  

                                                                 LEFT OUTER JOIN

                                                                         EntityChangeLog

                                                                         ON

                                                                                 SLALog.EntityChangeLogId = EntityChangeLog.EntityChangeLogId

                                                         WHERE

                                                                 (

                                                                         rel.RelationshipTypeId = 'BA08F9BB-85C7-20D8-05E3-0035938CDDD5'

                                                                 )

                                                 )

                                                 as temp2

                                              WHERE

                                                 (

                                                     BaseManagedEntityId = t2.BaseManagedEntityId

                                                 )

                                          )

                    )

                    as LastModified

                    on

                            LastModified.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C=INC.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C

            /* Get SLA */

            left outer Join

                    (

                          select

                               rel1.SourceEntityId

                              , SLAs.TargetEndDate_4F17E5C2_86D5_05E8_35DE_6E012567DAB7

                          from

                               MTV_System$SLA$Instance$TimeInformation as SLAs

                               inner join

                                     Relationship as rel1

                                     on

                                          SLAs.BaseManagedEntityID=Rel1.TargetEntityId

                          where

                               rel1.RelationshipTypeId                  = 'BA08F9BB-85C7-20D8-05E3-0035938CDDD5'

                               and rel1.IsDeleted                    = '0'

                               and slas.IsCancelled_16DDBB6C_0E00_ACAD_4F04_D134E61AF82B = '0'

                    )

                    as SLA

                    on

                            SLA.SourceEntityId=INC.BaseManagedEntityId

            /*Status*/

            left outer join

                    (

                        select *

                        from

                           LocalizedText

                        where

                           (

                               LanguageCode = 'ENU'

                           )

                           AND

                           (

                               LTStringType = '1'

                           )

                    )

                    as Status

                    on

                            Status.LTStringId = INC.Status_785407A9_729D_3A74_A383_575DB0CD50ED

            /*Impact*/

            left outer join

                    (

                        select *

                        from

                           LocalizedText

                        where

                           (

                               LanguageCode = 'ENU'

                           )

                           AND

                           (

                               LTStringType = '1'

                           )

                    )

                    as Impact

                    on

                            Impact.LTStringId = INC.Impact_276C8DBF_2BC3_2374_665E_77FC76513017

            /*Urgency*/

            left outer join

                    (

                        select *

                        from

                           LocalizedText

                        where

                           (

                               LanguageCode = 'ENU'

                           )

                           AND

                           (

                               LTStringType = '1'

                           )

                    )

                    as Urgency

                    on

                            Urgency.LTStringId = INC.Urgency_D4A8FF0E_3074_B44F_54AD_CC201ABD9A6A

            /*Classification*/

            left outer join

                    (

                        select *

                        from

                           LocalizedText

                        where

                           (

                               LanguageCode = 'ENU'

                           )

                           AND

                           (

                               LTStringType = '1'

                           )

                    )

                    as Classification

                    on

                            Classification.LTStringId = INC.Classification_00B528BF_FB8F_2ED4_2434_5DF2966EA5FA

            /*Source*/

            left outer join

                    (

                        select *

                        from

                           LocalizedText

                        where

                           (

                               LanguageCode = 'ENU'

                           )

                           AND

                           (

                               LTStringType = '1'

                           )

                    )

                    as Source

                    on

                            Source.LTStringId = INC.Source_96FD9295_16FA_3D7A_5995_F805B7B01F21

                            /*

                            select * from RelationshipType where RelationshipTypeName like '%ltvalue%'

                            select * from MTV_System$SLA$Instance$TimeInformation

                            */

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    @alex_kokin

    Can you please start a new thread as this is a new topic and I will take a look. Also, please attach the script as a file as this is very hard to read.

    Thanks

  • alex_kokinalex_kokin Member IT Monkey ✭

    Hey Geoff, on that P1 required issue. Its is working fine however is there a way to also only make it only required when closing or resolving the ticket only?


    As it it now, when a user creates a ticket as a P1 they can not save unless they enter data in the RCA fields. I really only need that data when closed / resolved.


    Thanks again for your help.


    { DataType: "Boolean", PropertyDisplayName: "WAS INCIDENT RELATED TO A RELEASE", PropertyName: "ReleaseProperty", Inline: true,},

                        { DataType: "String", PropertyDisplayName: "ISSUE", PropertyName: "RCA_ISSUE", Required: pageForm.viewModel.Impact.Name === 'P1 - Critical'},

    { DataType: "String", PropertyDisplayName: "IMPACT", PropertyName: "RCA_IMPACT", Required: pageForm.viewModel.Impact.Name === 'P1 - Critical'},

    { DataType: "Enum", PropertyDisplayName: "AFFECTED SYSTEMS", PropertyName: "Affected_Systems", EnumId: 'e4ee206c-a502-fdab-ecb2-e0b042936aeb', Required: pageForm.viewModel.Impact.Name === 'P1 - Critical'},

    { DataType: "DateTime", PropertyDisplayName: "START", PropertyName: "RCA_Start", Required: pageForm.viewModel.Impact.Name === 'P1 - Critical'},

    { DataType: "DateTime", PropertyDisplayName: "STOP", PropertyName: "RCA_End", Required: pageForm.viewModel.Impact.Name === 'P1 - Critical'},

    { DataType: "Enum", PropertyDisplayName: "CAUSE", PropertyName: "RCA_CAUSE", EnumId: '9f19b929-0a53-4e88-8c44-b5ce34b8832a', Required: pageForm.viewModel.Impact.Name === 'P1 - Critical'},

    { DataType: "LongString", PropertyDisplayName: "CAUSE DETAILS", PropertyName: "RCACAUSEDETAILS", MinLength: 0, MaxLength: 4000, Required: pageForm.viewModel.Impact.Name === 'P1 - Critical' },

    { DataType: "LongString", PropertyDisplayName: "RESOLVED", PropertyName: "RCA_RESOLVED", MinLength: 0, MaxLength: 4000, Required: pageForm.viewModel.Impact.Name === 'P1 - Critical' },

    { DataType: "LongString", PropertyDisplayName: "NEXTSTEPS", PropertyName: "RCA_NEXTSTEP",MinLength: 0, MaxLength: 4000, Required: pageForm.viewModel.Impact.Name === 'P1 - Critical' },

    { DataType: "LongString", PropertyDisplayName: "ADO LINKS", PropertyName: "ADO_Links",MinLength: 0, MaxLength: 4000}

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    Hi,

    We can try with two expressions with an AND. I've not tested this yet but if you are able to...

    { DataType: "String", PropertyDisplayName: "IMPACT", PropertyName: "RCA_IMPACT", Required: pageForm.viewModel.Impact.Name === 'P1 - Critical' && pageForm.viewModel.Status.Name === 'Resolved'},
    

    Geoff

  • alex_kokinalex_kokin Member IT Monkey ✭

    Thank you sir, I will test it. So this should still allow a new P1 ticket to at least be saved before the fields are filled in right?

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    Hmm, as I think about it, that will not work.

    It will make the field required when the Impact is P1 AND the Status is Resolved. (at the point of page load)

    However, you will still be able to set it to resolved without filling that field in.

    You are going to need some custom JavaScript to force that field to be completed in order to Resolve.

    Geoff

  • alex_kokinalex_kokin Member IT Monkey ✭

    hmm I tested it and it allows me to save and resolved, however if I open it again it won't save without entering data.

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    Yeah, exactly. Not quite right.

Sign In or Register to comment.