Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It's currently possible to substitute the following:

  • Request URL

  • Request headers

  • Request body

  • Request Authorization

General usage

Variables are accessed by using the curly braces notation of Mustache. 

{{variable_name}} or for an object, the dot notated getter name without the "get".

Example: {{my_object.name}} . For the value of the getName() of the my_object variable

Value variables (Primitives/Strings ie.)

...

{{object_name.user.name}} - Substitutes the object_name getUsername getUser().getName() value value

Collections

Iterate through lists using the following Mustache pattern:

{{#title}}{{.}}{{/title}}

See Manage Arrays for further info

Formatting dates

Date objects can be formatted by using the following syntax. {{#date#date}}{{#format}}java_date_format_pattern{{/format}}{{/date}}

Example:

{{#issue.updated}} {{#format}} yyyy-MM-dd {{/format}} {{/issue.updated}} - Will format issue updated date. (since v.3.8.0)

...

Default variables that are available for every iHub integration request are:

Variable

Description

{{issue}}

The issue that triggered the request. (or was in context of the scheduled job).

 Note

 Note:

 Scheduled iHub

 Scheduled iHub integrations will only have an issue if an issue context scope has been defined.

{{now}}

Current date/time 

{{baseUrl}}

The Jira instance base url (since v1.0.1) 



Note

Upper case on "U" in baseUrl




{{#comments.all}}

Get all comments for the issue

Usage: {{#comments.all}} {{body}} {{/comments.all}} = Iterate all comments, print its body

Note: add more attributes or change {{ body }} to any other comment attribut, see Jira JavaDoc

{{comments.latest}}

Get the latest comment object for an issue. 

Usage: {{comments.latest.body}} = Latest comment body 


{{comments.latest.authorApplicationUser.displayName}} = Latest comment author name

{{customfield_id}}

Get custom field name.

example; {{customfield_10003}} is a field called "Multi User Picker"

When using  {{customfield_10003}} in the URL or Body it will resolve to Multi User Picker.

To get the value of the custom field use the {{issue.customfield_10003}}

{{currentUser}}

Returns the current user as a ApplicationUser object

String manipulation

Make a variable lowercase or uppercase

...

Define custom variables by defining them in the variables section of the child action.Image Removed

...


Set the variable name followed by the JSONPath expression.

...

Automatic response variables

Include Page
Automatic response variables
Automatic response variables


Issue object

Include Page
Issue Object Variables
Issue Object Variables


Parent object

Expand
titleClick here to expand Parent Variables
Include Page
Parent Variables
Parent Variables



Using variables

Expand

Use the variable in an URL

Template URL:https://my_jira_instance_url/rest/api/2/issue/{{issue.key}}/comment

If operated on an issue with the key "QWERY-123" this will be evaluated as

https://my_jira_instance_url/rest/api/2/issue/QWERTY-123/comment

...

Expand
titleClick here to expand Groovy Variables
Include Page
Groovy Variables
Groovy Variables


Expand
titleClick here to expand Static Variables
Include Page
Static Variables
Static Variables