- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2014 07:41 AM
I've seen the stage updated with a red X when the workflow for a Request Item is canceled. I would like to make that X appear under a certain error condition in my workflow. Does anyone know how I can accomplish that?
Below is a screenshot of what I am talking about.
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2014 11:48 AM
Ok, I figured out a really easy way to do it.
I have the conditions on a catalog task for 3 closed states (Closed Complete, Closed Incomplete, and Closed Skipped). The catalog task activity is set to the stage I want to show the rejected icon on if it fails. On the Incomplete and Skipped states I have it transition to a Run Script activity. The following is the code in the Run Script. It marks the previous activity as cancelled, which causes the red x to appear.
var gr = new GlideRecord('wf_history'); if( gr.get( activity.previous_activity ) ) { gr.state = 'cancelled'; gr.result = 'cancelled'; gr.update(); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2014 09:17 AM
Check out the Script Include called, "WorkflowIconsStages". It has the code that sets the icon. However it may not work depending on how you use it.
Are you planning on using the red X somewhere else or are you planning on adding it to the Stage display (like in your screenshot)?
The actual Red X is called workflow_rejected.gifx.
https://YOURINSTANCE.service-now.com/images/workflow_rejected.gifx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2014 01:32 PM
Thanks for directing me to that Script Include, that is helping. The stage choices get a state associated with them at some point. Now I just have to figure out where that is held.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2014 07:13 AM
It appears whether or not something is skipped, completed, or rejected depends upon the Workflow Activity History.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2014 11:48 AM
Ok, I figured out a really easy way to do it.
I have the conditions on a catalog task for 3 closed states (Closed Complete, Closed Incomplete, and Closed Skipped). The catalog task activity is set to the stage I want to show the rejected icon on if it fails. On the Incomplete and Skipped states I have it transition to a Run Script activity. The following is the code in the Run Script. It marks the previous activity as cancelled, which causes the red x to appear.
var gr = new GlideRecord('wf_history'); if( gr.get( activity.previous_activity ) ) { gr.state = 'cancelled'; gr.result = 'cancelled'; gr.update(); }