With Easy Integration's Issue Listeners, you can integrate your Jira with your internal/external systems by calling REST services accordingly. On this page, you will find out how to define a listener and configure the REST service.
...
- The endpoint of the REST service. You can type any dynamic parameter here using double curly braces. (e.g. http://mycompany.com/api/book/{{bookId}} assuming bookId is defined within the Parameters section which is described below.
- Select the Http Method (GET, POST, PUT, DELETE).
- Define your HTTP header key/value sets in separate lines (as shown in the screenshot).
Type the JSON request body - you can use dynamic parameters here as well. Note that, If send attachments is selected, request body must be in a form-data format where key-value pairs can be defined. Check code block below.
Code Block title Request Body form-data linenumbers true table_name = incident table_sys_id = d71f7935c0a8016700802b64c67c11c6
- Define all your dynamic parameters here. You can add static values as well as the dynamic values of fields/custom fields in the Jira issue. Below are some sample usages.
- Choose the authorization type. Currently, BASIC Authentication is supported. If you choose the Basic Authorization Type, the credential will become active and the credentials you defined in the Credentials section will be listed.
Headers code example:
...
For more details on parameter assigning and utils, see the Parameters Usage Examples page.
Also see ComponentAccessor, User, Issue and Status API for all properties and methods.
...
- First, tick the Update custom field checkbox.
- Select the custom field that you want to update from the drop-down menu.
- Type the jsonpath accordingly to select the value. If the result is not JSON and you want to update a custom field with the body itself, just leave this textbox empty.
See the jsonpath examples page for jsonpath samples.
Send Attachments
In this section, you will find out how to send attachments with REST call.
- First, tick the Send Attachments checkbox.
- Write the name of the form-data parameter name that contains attachments. For instance, in Jira REST Api for attachments, this name must be "file" and in ServiceNow REST API, this name must be "uploadFile"
Write a groovy script that returns attachments. These attachments will be sent with the REST Call. If script is empty, then all attachments will be sent.
Code Block language groovy title Send Attachments linenumbers true import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.issue.AttachmentManager; AttachmentManager attachmentManager = ComponentAccessor.getAttachmentManager(); def attachments = attachmentManager.getAttachments(issue); return attachments;