Catalog item to send request to one of two groups depending on choice

Thereza Van der
Tera Contributor

Hi everyone 🙂

 

I have a catalog item called 'Provision New Server', I would like to do the following:

 

If 'Linux' is chosen, it should send the request to a group called 'LinuxServers'

If 'Windows' is chosen, it should send the request to a group called 'WindowsServers'.

 

I tried several things, but not sure what the best would be. I attach a screenshot of the portal page. Please tell me what the best approach would be?

 

I tried a UI policy but cannot get it to work but before I struggle too much I would like to know what the best approach would be so that I can spend time figuring it out.

5 REPLIES 5

AshishKM
Kilo Patron
Kilo Patron

Hi @Thereza Van der , 

UI Policy will not work for task group assignment.

You need to configure this task group mapping in workflow ( or flow ).

In workflow check the OS value of set the task group via script code. 

 

Apply If condition and check the OS value and create the Catalog task for windows and linux separately. 

Or you can write code within the catalog task and check the OS -> set the assignment group.

 

Share the current workflow. 

 

-Thanks,
AshishKM

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Community Alums
Not applicable

Hi @Thereza Van der ,

 

UI policy won't be helpful to achieve your requirement. You can either use flow designer or workflow

 

Using flow designer:

Sai149_0-1716487190040.png

 

Sai149_1-1716487215409.png

 

I started answering community questions recently. If my answer helped you in any way, please mark it as helpful or correct. It would be a great boost.

swathisarang98
Giga Sage
Giga Sage

Hi @Thereza Van der ,

 

You can do it through flow or workflow as mentioned by Abhishek or you can create a business rule on ritm or sc_task based on your requirement,

 

Before insert:

Table: sc_req_item

condition: item is "your catalog item name"

swathisarang98_0-1716489296191.png

script:

 

(function executeRule(current, previous /*null when async*/ ) {

    var checkboxValue = current.variables.testTest; //checkbox backend value
    var checkboxValue_1 = current.variables.test_2_1;
    var checkboxValue_2 = current.variables.test_3_1;
  //  gs.info('check ' + checkboxValue + 'value 2 ' + checkboxValue_1 + 'value 3 ' + checkboxValue_2);

    if (checkboxValue == 'true' || checkboxValue == true) {
        current.assignment_group = gs.getProperty('assignment.rule.for.incident'); //created a property and stored the assignment group value 
    } else if (checkboxValue_1 == 'true' || checkboxValue == true) {
        current.assignment_group = gs.getProperty('assignment.rule.for.incident.haradware');
    }



})(current, previous);

 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Yousaf
Giga Sage

Hi @Thereza Van der,
Please check if this can work
Assigning a Request to a particular Group depending on Variable 

Mark Correct and Helpful if it helps.


***Mark Correct or Helpful if it helps.***