- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2016 11:10 AM
Hi,
My use case requires to call external REST API from ServiceNow when the incident state is changed. For example, our release pipeline will create a new incident (via inbound REST API call) for someone to approve this release. Once the incident assignee approves the ticket by changing the State (e.g. from New to Approved), it will trigger to call outbound REST API to our release pipeline. How to do that in ServiceNow to trigger such outbound API when State is changed?
Any advice would be appreciated.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 12:54 PM
That is because, when you click "Update" you are redirected to the recent page you opened. When you click save, you can still stay on the same incident form even after updating the form.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 10:53 AM
alert() method is only available on client side, it is not available for server side scripts like Business Rules, Script Includes. You can instead use gs.addErrorMessage(), gs.addInfoMessage() methods which are available on server side.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 12:34 PM
My bad. I was thinking it's still the client script.
I've changed to use gs.addInfoMessage() on the script. Where can I see the test message?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 12:45 PM
when you change state to "Awaiting Evidence" on the incident form click save or update, your business rule is triggered and you should see the message on top of the incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 12:51 PM
I see the message on top of the incident page now. But the page content becomes the definition of Script IncludeKeylinesBsmAJAX code instead of the original incident form page.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 12:54 PM
That is because, when you click "Update" you are redirected to the recent page you opened. When you click save, you can still stay on the same incident form even after updating the form.