Advanced (Scripting)
Advanced mode (scripting) provides a way to customize app logic when it comes to build data that is going to be sent out to apps via API. More about it you can read here https://getint.io/introducing-getint-io-advanced-scripting/
Script should be compliant with JS syntax. It is basically JavaScript code that is run by GetInt when specific events will be triggered.
Events for which you can define script and available functions / variables:
Is run every time just before integration runs
api.leftApp.fetch(url) - fetch data from endpoint from LEFT side app
api.leftApp.post(url, postData) - post data to LEFT side app
api.rightApp.fetch(url) - fetch data from endpoint from RIGHT side app
api.rightApp.post(url, postData) - post data to RIGHT side app
api.log(string) - write a log line to log file of the run
Is run before CREATE or UPDATE requests are sent with item data
api.leftApp.fetch(url) - fetch data from endpoint from LEFT side app
api.leftApp.post(url, postData) - post data to LEFT side app
api.rightApp.fetch(url) - fetch data from endpoint from RIGHT side app
api.rightApp.post(url, postData) - post data to RIGHT side app
api.log(string) - write a log line to log file of the run
state.syncAction - Create or Update
state.reqObj - request object data (containing fields) that was prepared by GetInt
state.triggerObj - data of the trigger/source object
e.g. if ITEM-1 was modified in Jira and will be synced with Azure Work Item #32,
state.triggerObj
contains data of ITEM-1 and state.reqObj
is a constructed data object that will update #32api.leftApp.fetch(url) - fetch data from endpoint from LEFT side app
api.leftApp.post(url, postData) - post data to LEFT side app
api.rightApp.fetch(url) - fetch data from endpoint from RIGHT side app
api.rightApp.post(url, postData) - post data to RIGHT side app
api.log(string) - write a log line to log file of the run
state.comment - comment data that was prepared by GetInt to send
If
state.comment.skipped
flag is set up and equal true
comment will be skipped and request won't be send.Last modified 23d ago