- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 08:39 PM
Hello Developers,
I'm trying to create a REST OUTBOUND Integration.
I'm able to pass static & dynamic values but not both at the same time.
I want to send Description as 'static' & rest values as dynamic.
I have tried adding static description under HTTP Query Parameters & BR, Also tried by keeping them at 1 place either HTTP Query Parameters or BR. But no luck.
{
"description' : 'Naveen is learning Outbound Integration'
}
Please suggest.
var request = new sn_ws.RESTMessageV2('Naveen - Learning','Create Incident'); // REST Message & HTTP Method
request.setStringParameterNoEscape('u_caller_id',current.caller_id); // 'REST defined variable', 'source varaible'
request.setStringParameterNoEscape('u_short_description',current.short_description);
request.setStringParameterNoEscape('u_priority',current.priority);
request.setStringParameterNoEscape('description','Naveen is learning Outbound Integartion');
var response = request.execute();
var responseBody = response.getBody();
var statusCode = response.getStatusCode();
var responseError = response.getErrorCode();
gs.info("responseBody " + responseBody );
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2024 02:44 PM
Hi Naveen,
Can you check the integration user roles in the target instance? User must have 'sn_incident_write' role assigned as there is an OOB ACL on description field which allows only user's with the role to write to this field. If the role is missing, please add & give it a try. Let me know if it worked.
Best Regards,
KK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2024 02:44 PM
Hi Naveen,
Can you check the integration user roles in the target instance? User must have 'sn_incident_write' role assigned as there is an OOB ACL on description field which allows only user's with the role to write to this field. If the role is missing, please add & give it a try. Let me know if it worked.
Best Regards,
KK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2024 12:48 AM
Thank you so much.
Once roles were assigned.
Both Static & Dynamic values were received from Source & set on Target table.(Description Field).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2024 03:17 AM
Hi @Naveen87 ,
Please modify HTTP Request content as below:
{
"caller_id":"${u_caller_id}",
"short_description":"${u_short_description}",
"priority":"${u_priority}",
"description":"${description}"};
Also check if the User which is creating the incident at target instance have proper role to write on description field. Check the ACL for description field.
Hope this helps.
Thank you,
Himani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2024 03:51 AM
The script itself should be Ok, but your content doesn't have a description in it.
{
"caller_id":"${u_caller_id}",
"short_description":"${u_short_description}",
"priority":"${u_priority}",
"description":"${description}"
}
The content just specifies what is being sent and it doesn't matter what your script adds if it's not part of the content. So whenever you want to add a field into the rest message, you'll have to add it both to the business rule AND the rest message function. Also note that here you named the other fields starting with u_ and in the script description without u_.
It's a good idea to use the same naming convention for all. In this case it doesn't matter if it's a variable, field or a custom field as you're allowed to name them how you want in the rest content. Just make sure they match between the content and BR.