Query Changes which contains specific change-tasks assignment-groups

Benedikt Kaiser
Tera Contributor

Hi,

in my current projekt I need to search for changes which have change-tasks with specific assignment-groups.

 

Currently I'm using: 

api/sn_chg_rest/v1/change?sysparm_query=statestate=1^assignment_groupLIKETS&sysparm_display_value=true
 
but assignment_group is not the correct field, as this is only the group from the change but not from the change-tasks.
 
Can I do this somehow in one go?
 
Best regards,
Benedikt
 
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Benedikt Kaiser 

I think you are using Change Management API. Are you giving this endpoint to some 3rd party and they want to fetch the details.

It doesn't support query on change_task table

You can search Change Task but using CHG SysId

Both the GET APIs cannot be used

AnkurBawiskar_0-1704719436010.png

 

So you need to use Scripted REST API and create a custom endpoint and once they hit the API the response can be shared by using GlideRecord in that scripted REST API

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Benedikt Kaiser 

 

Create a report on change task table and filter the assignment group

 

LearnNGrowAtul_0-1704718427011.png

 

or

 

assignment_group=477a05d153013010b846ddeeff7b1225

 

*************************************************************************************************************
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]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@Benedikt Kaiser 

I think you are using Change Management API. Are you giving this endpoint to some 3rd party and they want to fetch the details.

It doesn't support query on change_task table

You can search Change Task but using CHG SysId

Both the GET APIs cannot be used

AnkurBawiskar_0-1704719436010.png

 

So you need to use Scripted REST API and create a custom endpoint and once they hit the API the response can be shared by using GlideRecord in that scripted REST API

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader