- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2013 06:15 PM
Is it possible to set the Request State using Run Script from a Request Item workflow? 
I tried using: current.request.request_state = 'requested';
Not working...
Solved! Go to Solution.
- Labels:
- 
						
							
		
			Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2013 01:38 AM
Run a query to access the request table and update the state
I use this all the time to set short descriptions from a request item
var req = new GlideRecord('sc_request');
req.addQuery('sys_id', current.request);
req.query(); 
while (req.next()) { 
 req.request_state = 'requested';
 req.update();
}
 
					
				
		
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 04:58 AM
How about this?
var req = new GlideRecord('sc_request');
req.addQuery('sys_id', current.request);
req.query();
while (req.next()) {
req.request_state = current.request_state;
req.update();
}
I would avoid code with hard coded values.
Rather, I would want to copy the request_state from the RITM.
If this post was helpful, I would appreciate if you marked it as such - thanks!
Best
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 07:11 AM
I tried that, but to no avail.
It seems that current.request_state is not updated?
If this post was helpful, I would appreciate if you marked it as such - thanks!
Best
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2013 04:52 AM
Perfect! Much appreciated!
