...
The action then takes the input from the incoming REST call and sends that to JIRA in the format JIRA expects.
Three-step process
Status | ||||
---|---|---|---|---|
|
The external system POST data to iHUBs URL, which is stated in on the Incoming page.
URL ends with /rest/restfulintegrator/1.0/incoming
Status | ||||
---|---|---|---|---|
|
...
And specify what conditions need to be fulfilled for the rule to pass the data to an iHUB action.
Conditions | Description |
---|---|
User | Execute of the user is equal or not equal to the specified user |
Data | Use JSON Path - Pick data from response expression to check if the payload includes valid data before executing. |
URL | add any query param to the POST iHUB URL, such as
To distinguish between systems. |
On the Action, part select the iHUB action that will be triggered if the condition is true.
...
On your Firewall open up <baseurl>/rest/restfulintegrator/1.0/incoming/014aed18-c4d2-4166-9745-39648cce64e9
(we have used https://www.uuidgenerator.net/ to generate the UUID)
Then on iHUB Incoming rule use this as a URL Condition which says
Operand ~ (contains)
- Value 014aed18
Value 014aed18-c4d2-4166-9745-39648cce64e9
Response from Incoming REST end-point
...
This is setup from the Rule. Open Incoming, select to edit a rule and under the section Rule HTTP Response select:
Triggered Action(s) Response
This rule will now wait for its action to complete before returning a response. By default, due to backward compatibility, the response is returned as a single object (if the request matches one rule) , if more rules are triggered in the same request an array of responses will be returned. If you wish to always return an array of objects (one or more) this can be set up under the “Settings” menu.
Make sure this is set to On.
Response Rule 2. Always return response as an array, response rule 1 needs to be disabled to make this apply.
Note: Debug must be switched off
Sample of response:
Incoming Rule With Action Response
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "actionId": 1, "actionName": "Create Issue" , "httpStatusCode": 201 , "responseData": { "id": "10000", "key": "SEAG-1", "self": "http://localhost:2990/jira/rest/api/2/issue/10000" }, "requestData": { …omitted.. } } ] |
More info on Http Rule Response
Incoming requests with files (multipart data)
...
URL for incoming files is: rest/restfulintegrator/1.0/incoming/files
This can, of course, be combined with a UUID to secure firewall openings ie: rest/restfulintegrator/1.0/incoming/files/014aed18-c4d2-4166-9745-39648cce64e9
Using incoming files in iHub actions
Using the incoming files in an action is simple, just enable "Incoming files" under the Attachments sections in the "Actions" page.
...
The integration action request will now be sent as a multipart/form-data request with the incoming files in the request.
...