- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 02:58 AM
Hello All,
I want to check TASK status in the workflow, if TASK is closed I want Make RITM and REQ closed and If TASK is cancelled I want to Make RITM/REQ cancelled, I want check task status in work flow and then set up RITM/REQ status from workflow, please find the below screen shot
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 10:25 PM
Finally got the solution
Since the workflow is on the Requested item, current.task.state refers to current requested item status which is not closed complete. hence all the requested items are going to cancelled state. use below script after the catalog task activity.
answer = check();
function check()
{
var gr_tsk = new GlideRecord("sc_task");
gr_tsk.addQuery('request_item', current.sys_id);
gr_tsk.query();
gr_tsk.next();
if(gr_tsk.state == 4) //check for task status closed incomplete
{
return 'yes';
}
return 'no';
}
after if, for yes you will have Set values activity with status and stage as Closed complete and completed respectively. for no, it will be Closed incomplete and Request Cancelled.
remember, this will work if there is only one task for the requested item.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 03:09 AM
you can add custom transition in your catalog task activity so that if user will cancel the workflow you can set the transition to the end . also add the setValue activity so that stage value will get updated based on the task state.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 03:27 AM
adding screenshot below.
open the catalog task activity and then go to the bottom, you will see the related link "Condition" , click on that and add the custom transition .
once you will create a new condition then there you will see condition field. mention the below line
activity.result == 'cancelled' // this is the catalog task state value.
activity.result == 'complete';
now you will get the another transition , and here once user will cancel the task you can set the transition to end point.
Hope it will help you..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 03:51 AM
Here my TASK state "Cancelled" value is "-10", how can I configure it in the custom transition
activity.result == -10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 03:55 AM
go to the catalog task activity which you have added on workflow. you will find the condition related link, click on that and there you can add new condition , and while creating new condition you will see the condition field. just mention the activity.result == -10