Can ServiceNow create Change ticket via REST API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 03:27 AM
Hi All,
I would like to create Change ticket and Change Task from another application.
ServiceNow provide Table API for create/update/delete ticket. However, I don't know about insert impact assement or any thing for execute Change management flow.
Could you please sugguest me?
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 06:39 AM
You can test in Dev, but the flow should work the same regardless of if you insert the Change via REST API or through the UI.
Also, rather than giving the external application direct access to the Change Request table, it's usually best practice to create a staging table/transform map instead. Then the service account will just have access to the staging table.
The external account will use REST API to insert to staging table -> transform map will run to insert record into Change Request table -> Change flow should execute normally.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 08:14 AM
Hi Mike,
I already created Change ticket with Table API but I create impact assessment via REST API is not working.
This is table about assessment -> asmt_assessment, asmt_assessment_instance, asmt_metric.
I already create follow upper tables and put change ticket value in those tables. But it's not a calculated impact assessment.
after that, I try to put the result in to asmt_metric_result table and insert change ticket for related both record. it's not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 08:31 AM
Hi,
If you are using the REST API post method then all client side logic will not trigger. You have to write additional code at "When to Run = INSERT" in change_request table to calculate "impact assessment".
Alternatively, you can use scripted REST API ( instead of Table API ) and read the input JSON and perform all internal logic and then insert the record in change_request. This way entire logic will be at one place with control in hand.
Thanks,
Ashish
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 08:46 AM
Hi Ashish,
it still doesn't have "Completed Impact Assessment" on related link.
I try to click "impact assement" on that change ticket from REST API. It doesn't warnning "You have already completed the risk assessment. Would you like to edit your existing risk assessment?"
If i see link or found exisiting risk assessment record that I will try to copy script and create new business rule at "when to run = insert" for trigger calculate impact assessment,
PS. REST API will called by another application outside ServiceNow environment. it mean I can't use scripted REST API feature.