- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 08:13 AM
I'd like to show the stages of a requested item on the RITM. Since I only want this to only show for this particular catalog item, I created a variable "item_stage". Whenever the stage changes, I want the RITM variable to be updated. What I tried to do is that every time the SCTASK is created, I run this script:
current.variables.item_stage = current.stage;
I'm not sure if this is the best approach or the right syntax. I can't get this to work because the field is just blank:
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 02:55 PM
Wait, I've had an epiphany. Scrap all that and create an after update business rule on sc_req_item with the Filter Condition Stage changes
You can also add certain Items to the Filter Conditions, but if this variable is not found it just won't do anything - no errors displayed, or erratic behavior. Add this Script in the Advanced tab
(function executeRule(current, previous /*null when async*/) {
current.variables.item_stage = current.stage.getDisplayValue();
current.update();
})(current, previous);
Now the variable will be updated every time the RITM stage changes. The workflow I'm testing with starts with a run script to set some RITM values, then an approval, a task, then another approval. I noticed when I submitted the request the RITM stage showed Approval as it was awaiting the first approval, but the variable was empty. This is a timing issue that I've seen before on RITM creation, so adding a 10 second Timer activity prior to the approval did the trick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 08:25 AM
Why not display the field on the RITM form?
You could add a UI Policy or Client Script (not catalog) on sc_req_item if you want to hide the field based on cat_item.
If you really want to populate a variable, this will work in your workflow script
current.variables.item_stage = current.stage.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2025 05:02 PM
I like this idea, Brad. How did you get the workflow chevrons to appear at the top of the RITM? I'm not actually sure what they are called. Are they an option when selecting a variable type?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2025 03:52 AM
You can find that in Process Flow in the left nav. On the sc_req_item table you would create a record for each chevron that you want to appear, giving it conditions for when that one will be active, then if it's not already there, add Process Flow to the form via Form Layout / Designer...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 09:03 AM
Hi Brad,
The idea behind adding the stage as a variable is so that it shows up in the approval form as shown below:
There's multiple approval tasks in the workflow (1 in the beginning and 1 close to the end). The approver wants to know what he's approving. So we figured we can show the stage of the workflow to show the stage of fulfillment.
Since we can't really do anything on the approval form to show the RITM stage, we figured this is the next best thing we can do.
What do you think?