Notify operation in the Jira adapter


This topic provides input and output elements, and sample XML requests and responses for the operations in the Notify folder. 

When you use a context item as an input for an adapter request, you must enclose the adapter request in the <request-data> elements. However, when you create a static request, <request-data> is not required and the adapter request starts with the <jira-adapter-request> element. 

Notify

Sends notifications about updates made to an issue in Jira. Users that are watching the specified issue receive email notifications. 

The following table describes the input elements for the adapter wrapper process. 

Input element

Description

Required

adapter name

Specifies the name of the adapter as configured on the grid.

Default value: Jira Adapter

No

JSESSIONID

Specifies the Jira session ID that you obtained after running the Login request.

Yes

issue key

Specifies the issue key or issue ID for which you want to add a comment.

Yes

input data

Contains the email body, in a JSON format.

Example:

{
"textBody": "Notification text here",
"to": {
"reporter": true
}
}

For more information, see the schema section in Jira API documentation:
https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-notify

Yes

return data format

Specifies the data type for the adapter response 

Valid values: XML, JSON (default)

No


If using the Call Adapter activity in the Development Studio, the following table describes the input elements for the adapter request. 

Input element

Description

<operation-name>

Specifies the name of the operation.

Valid value: notify

<headers>

Specifies the header details for the adapter request, in a JSON format.

Contains the issue-key and return-data-format.

Name

Description

<issue-key>

Specifies the issue key or issue ID.

This is a required element.

<return-data-format>

Specifies the data type for the adapter response 

Valid values: XML, JSON (default)

<cookie>

Specifies the JSESSIONID cookie obtained during the Login operation.

<body>

Contains the request body for adding a new comment for a specified issue.

Example:

<![CDATA[{
"textBody": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit.",
"to": {
"reporter": true,
"assignee":true,
}
}]]>

The following figure shows a sample XML request for the operation.

<jira-adapter-request>
   <headers><![CDATA[{
"return-data-format":"XML",
"issue-key":"DRAOC-12345",
"headers":{
"Content-Type":"application/json",
"Cookie":"JSESSIONID=FDB2845616908A3919530A38F97CD5C7"
}

}]]></headers>
   <operation-name><![CDATA[notify]]></operation-name>
   <body><![CDATA[{
"textBody": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit.",
"to": {
"reporter": true,
"assignee":true,
}
}]]></body>
 </jira-adapter-request>

The following figure shows the adapter response for the request.

<jira-adapter-response>
 <metadata>
   <status>success</status>
 </metadata>
 <status-line>
   <code>403</code>
   <reason>403</reason>
 </status-line>
 <header-lines>
   <Date>Thu, 24 Oct 2019 07:57:08 GMT</Date>
   <Server>Apache/2.4.29 (Red Hat)</Server>
   <X-AREQUESTID>177x1748x1</X-AREQUESTID>
   <X-ASESSIONID>197ghal</X-ASESSIONID>
   <X-ANODEID>phx-jiraqa-01</X-ANODEID>
   <X-XSS-Protection>1; mode=block</X-XSS-Protection>
   <X-Content-Type-Options>nosniff</X-Content-Type-Options>
   <X-Frame-Options>SAMEORIGIN</X-Frame-Options>
   <Content-Security-Policy>frame-ancestors 'self'</Content-Security-Policy>
   <X-ASEN>SEN-L13798850</X-ASEN>
   <X-Seraph-LoginReason>OK</X-Seraph-LoginReason>
   <Set-Cookie>atlassian.xsrf.token=BXV8-9FAB-2I0V-4AN7_65d6a0673e95691a8e6db30188dd0a48a4ea15ea_lin; Path=/</Set-Cookie>
   <X-AUSERNAME>jiradev1</X-AUSERNAME>
   <Cache-Control>no-cache, no-store, no-transform</Cache-Control>
   <Vary>User-Agent</Vary>
   <Content-Type>application/json;charset=UTF-8</Content-Type>
   <Connection>close</Connection>
   <Transfer-Encoding>chunked</Transfer-Encoding>
   <X-RBT-SCAR>172.29.65.114:881154128:1000</X-RBT-SCAR>
 </header-lines>
 <message-body>
   <errorMessages>
     <e>Outgoing emails disabled.</e>
   </errorMessages>
   <errors />
 </message-body>
</jira-adapter-response>

The following table describes the output elements for the adapter request. 

Output element

Description

status

Shows the status of the operation.

Valid values: success, failure

error message

Shows the error message, in case the operation fails.

response headers

Contains the adapter response for the operation.

<header-lines>
<Date>Tue, 22 Oct 2019 20:13:56 GMT</Date>
<Server>Apache/2.4.29 (Red Hat)</Server>
<X-AREQUESTID>913x1697x1</X-AREQUESTID>
<X-ASESSIONID>4gi376</X-ASESSIONID>
<X-ANODEID>phx-jiraqa-01</X-ANODEID>
<X-XSS-Protection>1; mode=block</X-XSS-Protection>
<X-Content-Type-Options>nosniff</X-Content-Type-Options>
<X-Frame-Options>SAMEORIGIN</X-Frame-Options>
<Content-Security-Policy>frame-ancestors 'self'</Content-Security-Policy>
<X-ASEN>SEN-L13798850</X-ASEN>
<X-Seraph-LoginReason>OK</X-Seraph-LoginReason>
<Set-Cookie>atlassian.xsrf.token=BXV8-9FAB-2I0V-4AN7_0a96479e64f90bdfadc4c30fb3016fbe227e8d98_lin; Path=/</Set-Cookie>
<X-AUSERNAME>jiradev1</X-AUSERNAME>
<Location>http://jiraapiqa.bmc.com/rest/api/2/issue/1171341/comment/1239007</Location>
<Cache-Control>no-cache, no-store, no-transform</Cache-Control>
<Vary>User-Agent</Vary>
<Content-Type>application/json;charset=UTF-8</Content-Type>
<Connection>close</Connection>
<Transfer-Encoding>chunked</Transfer-Encoding>
<X-RBT-SCAR>172.29.65.114:877653103:1000</X-RBT-SCAR>
</header-lines>

response body

Contains the body in the adapter response.

<result>
<errorMessages>
<e>Outgoing emails disabled.</e>
</errorMessages>
<errors />
</result>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Orchestration Content 24.3