- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2015 08:05 AM
I have an item on the service catalog that contains a reference variable called "Line Manager". I need to modify the workflow, so an activity can be included to create a task for the "Line manager" to approve the request.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2015 12:10 PM
I see it now. You are running that workflow on the request table and not the Request Item as I thought. That is why the activity is being skiped. Please add the following script on the approval activity and let me know if it works (Might need to work further):
//Begin Script
answer = [];
var item = new GlideRecord('sc_req_item');
item.addQuery('request', current.sys_id);
item.query();
while (item.next()) {
if( (item.variables.line_manager != '') {
answer.push(item.variables.line_manager.sys_id);
}
}
//End Script
Note: If it did not work with "answer.push(item.variables.line_manager.sys_id);" please try again with "answer.push(item.variables.line_manager);"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2015 11:23 AM
Try this one, may vary depending on the servicenow Version:
answer = [];
answer.push(current.variables.line_manager.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 04:29 AM
Thanks but that did not work either. I got the same result. By the way, the ServiceNow version is Eureka.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2015 12:28 PM
Is the line_manager variable actually set as a reference?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 04:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 11:30 AM
in your script add a line
current.comments = <whatever you are pushing>
and then execute it.. see what the comment gets added to the item... it SHOULD be the sid of the approver.. if not you will know what IS being pushed....
next question does this person <the one in the test case> have a valid email device?! if there is no email addy it can't generate an approval...
next when you mouse over the approval on the flow where it didn't work are there any comments.. is it green red or blue?! what about if you look in the workflow context any log entries?