- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2017 03:28 AM
Hi All,
Requirement :
A variable field on RITM will have 2 options based on which 2 tasks should be configured in workflow
1) if option A is selected then TASK A should be created.
2) else if option B is selected the TASK B should be created
Overall only 1 catalog task should be created based on the selection done, How can this be achieved.
Thanks in advance,
Sohan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2017 04:15 AM
Hi,
Please follow the below steps to achieve your requirement:
1) For example I have a Variable(Select Type Box) named "Select"on the Catalog Form having Choices "Choice 1or Choice 2". So as per your requirement, If I select the Value as "Choice 1" then Catalog Task named "Catalog Task 1" would be generated else the other one.
For this you need to use a "IF" block activity in the workflow and then based on the IF block you can link your workflow to the Respective Task as shown below:
1) Catalog Item screen shot with Demo Variable having choices as mentioned above:
Workflow:
If Block Code used above in the Workflow:
Script:
answer = ifScript();
function ifScript() {
if(current.variables.Select == 'choice1') { // Replace your Variable Value and Choice Value in place of Select and Choice1
return 'yes';
}
return 'no';
}
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2017 04:15 AM
Hi,
Please follow the below steps to achieve your requirement:
1) For example I have a Variable(Select Type Box) named "Select"on the Catalog Form having Choices "Choice 1or Choice 2". So as per your requirement, If I select the Value as "Choice 1" then Catalog Task named "Catalog Task 1" would be generated else the other one.
For this you need to use a "IF" block activity in the workflow and then based on the IF block you can link your workflow to the Respective Task as shown below:
1) Catalog Item screen shot with Demo Variable having choices as mentioned above:
Workflow:
If Block Code used above in the Workflow:
Script:
answer = ifScript();
function ifScript() {
if(current.variables.Select == 'choice1') { // Replace your Variable Value and Choice Value in place of Select and Choice1
return 'yes';
}
return 'no';
}
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2017 06:19 AM
Thanks a lot sholke, that was exactly what I was looking for. Your screenshots saved me a lot of time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2017 04:15 AM
Hi Sohan,
Please use a run script activity and you can write the script as needed.
if(current.variables.<VariableName> == 'VALUE')
create_catalog_task('SYS_ID_OF_GROUP')
function create_catalog_task(grp){
var sc_tsk = new GlideRecord('sc_task');
sc_tsk.initialize();
sc_tsk.request = current.request;
sc_tsk.request_item = current.cat_item;
sc_tsk.priority = current.priority;
sc_tsk.assignment_group = grp;
// Add rest of fields that you would like to copy from request_item to task
sc_tsk.insert();
}
Please mark as correct or helpful based on your result.
Regards
Param