- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2015 11:23 AM
HI All
Well i am making an rest call using a service catalog item, where couple of fields need to fill as per customer request. i am using variable substitution to make it work.
Can i know how these substitution will work from the service catalog as the user give input when ordering the item rest need to be collected to create an item.
Thanks
Dilip
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2015 04:16 PM
Use the same format as you would in a Business Rule, etc:
try {
var r = new sn_ws.RESTMessageV2('Amazon Web Services', 'get');
r.setStringParameter('action', current.variables.my_svc_cat_var1);
r.setStringParameter('version', current.variables.my_svc_cat_var1);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}
catch(ex) {
var message = ex.getMessage();
}
If you're using the REST Message Workflow activity:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2015 04:16 PM
Use the same format as you would in a Business Rule, etc:
try {
var r = new sn_ws.RESTMessageV2('Amazon Web Services', 'get');
r.setStringParameter('action', current.variables.my_svc_cat_var1);
r.setStringParameter('version', current.variables.my_svc_cat_var1);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}
catch(ex) {
var message = ex.getMessage();
}
If you're using the REST Message Workflow activity:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2016 09:16 AM
Hi Valor,
Am trying to create a change request through REST Message Activity, when the workflow execution completes, record gets created with empty data.
When I log the Varibales , data comes from the RITM as expected. Any thoughts?
REST API, POST METHOD
Am passing variables 'as short_description=${current.variables.short_description}, cmdb_ci=${current.variables.ci}'
Regards,
Mahesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 10:11 AM
Are you creating a change request on the same SN System using the REST web service? If so, that's the hard way. 🙂
Just use the GlideRecord API, and eliminate a webservice call to itself. 🙂