Service Now API endpoint should accept the callbackURL parameter

Renu9
Tera Contributor

Hi All,

I m having a requirement where Service Now API endpoint should accept the callbackURL parameter and use that when state changes on change request.

Could anyone please help me with the steps how ServiceNow API endpoint to accept the callback URL.

I am using a REST message here. The callback URL would be dynamic for each change request.

Service Now API endpoint should accept the callbackURL parameter

 

@Ankur Bawiskar  could you please guide here

1 ACCEPTED SOLUTION

@Renu9 

I already shared to use variable substitution and you can use setString method of RestMessage class

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Renu9 

you can use variable substitution and set it dynamically

what did you start with and where are you stuck?

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

Hi @Ankur Bawiskar ,

These are the variable substitutions . I need to pass sys ID of change request, state and change request number to the call back URL whenever state changes

Renu9_0-1675407625152.png

 

Renu9_1-1675407704108.png

The end point which I have put should be a dynamic one for each change request. The token, project number and feature would be unique for change requests.

https://gitlab.devops.prdroot.net/api/v4/projects/6167/trigger/pipeline?token=glptt-888af59d82e2e08e...

 

So when state changes in ServiceNow for a CR, it needs to POST to the callbackURL with the current status of the CR.

 

Whenever a state changes need to pass the above 3 values to this callback URL end point

Please suggest me how can I provide a dynamic URL 

 

harry24
Tera Contributor

have you got solution on this ?

HI @Ankur Bawiskar , Could you please help with the dynamic script of calling rest message end point .

I have also shared the steps that I tried and where I'm struck..kindly guide