Now, you can define custom variables in ARN template JQLs and pass their value from a Webhook URL parameter.
Use case this tries to solve is - if the external application has some additional parameter that is also available in Jira. e.g. passing labels from the external application.
Let’s see the steps:
Step 1
Create/edit any type of template in ARN
In the JQL section within the template, include a custom variable in the JQL like this. [labelName] is the custom input variable below.
project = "[projectId]" and fixVersion ="[versionId]" and labels = "[labelName]"
While passing values of custom variables in the webhook URL, spaces and special characters should be replaced with relevant URL encoded values. Example : If the value of a labels field is “ARN & Roadmap Portal”, then it will be passed in the webhook URL like this:
JQL : project = "[projectId]" and fixVersion ="[versionId]" and labels = "[labelName]"
You can use any online service like this to convert the variable value in valid format.
Important points to note
Like version variable, passing value of custom variable in the Webhook URL is optional and rule would still get triggered when additional parameter is not passed.
Like version variable, you can include multiple variables for the same field in the JQL and then pass their corresponding values in the webhook URL. Example: Value of two labels field variables (ARN & Upraise) is passed in webhook URL below
JQL :
projoect="[projectId]" and fixVersion ="[versionId]" and labels in ("[labelName]","[labelName1]")
You can include multiple such custom variables in the JQL and pass their values to webhook URL Example: Value of a labels field (ARN) and component field (Rules) is passed in webhook URL below JQL :
projoect="[projectId]" and labels = "[labelName]" and components = "[componentName]"
In case the template has multiple JQLs and the custom variable is included only in few of them, system shall ignore the custom variable passed in webhook for the JQLs in which that custom variable is not included.
In case of custom variables for user picker fields like assignee, reporter, while passing their value in the webhook URL, use their Jira account id instead of Jira user names. Example : in below JQL, if you have to pass variable value for the Jira user “John W”, you have to use his Jira account Id. JQL :
projoect="[projectId]" and assignee="[assigneeName]"