change assessment via API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hello,
I have a requirement where the customer want to do the change risk assessment via API.
Can anyone please guide me how to achieve this ?
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hi @rkbehera080
https://www.servicenow.com/community/developer-forum/risk-assessment-ap/m-p/2519750
The Risk Assessment data for a Change Request can be accessed via the REST API using the Table API. You can use the Change Request API (change_request table) and the Risk Assessment API (asmt_assessment_instance table) to retrieve or update risk assessment data.
- ServiceNow REST API for Risk Assessment in Change Requests
- Retrieve Risk Assessment for a Change Request
To get the risk assessment data for a specific change request, you can query the assessment instance linked to the change request.
API Endpoint:
- This API retrieves assessment instances related to change requests.
- You can modify the query to filter for specific change records.
Example cURL Request:
curl -X GET "https://your-instance.service-now.com/api/now/table/asmt_assessment_instance?sysparm_query=source=ch..." \
--header "Accept: application/json" \
--header "Authorization: Basic YOUR_CREDENTIALS"
- Get Risk Assessment from the Change Request Table
You can also directly query the change_request table and retrieve the risk level field.
API Endpoint:
- This retrieves all change requests with risk level and impact values.
Example cURL Request:
curl -X GET "https://your-instance.service-now.com/api/now/table/change_request?sysparm_fields=sys_id,number,risk..." \
--header "Accept: application/json" \
--header "Authorization: Basic YOUR_CREDENTIALS"
- How to Find the API in ServiceNow?
If you want to discover available APIs in your ServiceNow instance:
- Navigate to REST API Explorer
- In ServiceNow, go to System Web Services > REST API Explorer.
- Select Table API and choose the change_request or asmt_assessment_instance table.
- Experiment with API calls and test responses.
- Use API Documentation
- Go to System Web Services > REST API Explorer > API Documentation.
- Look for Table API or Assessment API to find specific endpoints.
- Create a Risk Assessment via API
To create a new risk assessment for a change request, send a POST request to the assessment instance table.
API Endpoint:
POST https://your-instance.service-now.com/api/now/table/asmt_assessment_instance
Example JSON Body:
{
"source": "change_request",
"source_id": "CHANGE_REQUEST_SYS_ID",
"state": "in_progress",
"due_date": "2025-03-01 12:00:00"
}
Summary:
- Use the asmt_assessment_instance table to fetch risk assessment data.
- Use the change_request table to get the risk level.
- Use REST API Explorer in ServiceNow to test and find the right API.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
We need more information than that. What is their exact requirement?
Do they want to do it from a different system? Do you need to export the assessment and get the answers back, or is there a different system they want to put the answers in and do you need to map them back?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark