- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2021 11:57 PM
Hello All,
I have a catalog item which is having 3 catalog tasks.
1) to A team
2) to B team
3) to C team
So If A team task is set to closed incomplete then B and C tasks should not get triggered and also RITM(state and Stage) and Request state should also set to closed incomplete.
Please assist.
Thank you,
Priya.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2021 02:57 AM
your workflow is running on RITM so you cannot check State of RITM since you want to know state of Catalog Task
You need to check state of the catalog task for this RITM by using Script
answer = ifScript();
function ifScript(){
var task = new GlideRecord('sc_task');
if(task.get('request_item', current.sys_id)){
if(task.state == '3'){
return 'yes';
}
else{
return 'no';
}
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2021 01:56 AM
Hi,
you are doing query on only that task which belongs to the current RITM
So no issue.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2021 01:57 AM
thank you for the confirmation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2021 01:59 AM
Glad to help.
Please remember to mark response helpful as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2021 01:57 AM
Glad that my script worked.
Please mark my response as correct and helpful and close the question so that it benefits future readers as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 03:34 AM
Hi Ankur...I had tried above code to check state = closed incomplete by just replacing state == 4 in below condition...but it is not working in my case.
if(task.state == '3'){
Can you please help me..I need to create another task when first task changes to 'Closed incomplete'.