CA Service Management

 View Only
Expand all | Collapse all

Restriction on field updation on a Request form based on requestor group membership during initial/opening a new request ticket

  • 1.  Restriction on field updation on a Request form based on requestor group membership during initial/opening a new request ticket

    Posted Sep 22, 2023 09:44 AM

    Scenario: Requestor from GroupA, while raising a Request ticket, a dropdown field should be mandatory to be filled when he is raising a new Request ticket whereas this field will not be mandatory or will appear as readonly for requestors not part of GroupA. 

    I am not able to fetch the group membership or create a PDM_IF condition based on the group membership. I tried below conditions:

    <PDM_IF "$args.group" == "0xB76160306F08CD4DB707CD457A70FC77"> ---this is not working

    ------------

    <PDM_IF "$cst.group.id" == "0xB76160306F08CD4DB707CD457A70FC77"> ---this is showing as incorrect condition

    Please help on the same.



    ------------------------------
    Sushovan Sinha
    ------------------------------


  • 2.  RE: Restriction on field updation on a Request form based on requestor group membership during initial/opening a new request ticket

    Posted Sep 26, 2023 04:27 AM

    You're test checks the Group on the ticket ($args.group), not if the Requestor (the logged on user) Groups.

    You need to use the $cst object and enumerate the groups it belongs (a Contact can be in more than one Group, I think you can use a PDM_LIST to enumerate them), then do the test against the Group UUID.




  • 3.  RE: Restriction on field updation on a Request form based on requestor group membership during initial/opening a new request ticket

    Posted Sep 27, 2023 04:23 AM

    Hello,

    You can do something like this:

    On your form add these code:

    var userBelongsToGroup='false';
    if (false 
          <PDM_LIST PREFIX="list" FACTORY="grpmem" WHERE="member = U'$cst.id'">
                || '$list.group' == "$args.group"
          </PDM_LIST>
    ){
         userBelongsToGroup='true';
    }
    if ( "$args.id" == 0 && userBelongsToGroup == 'true'){
         <Add your field that should be mandatory (Make required = yes)>
    } else {
         <Add your field as not mandatory (Make required = no)>
    }