Skip to end of metadata
Go to start of metadata
On this page


Post-function Create issue link is aimed to make it possible for a workflow transition to create issue links from current issue to other issues, or between any pair of issues in a Jira instance. Issue selection can be done by JQL query or comma separated issue keys in a field.

Example: Link issue across projects using reporter and user picker custom field

In the following example we configure a post-function to automatically create "relates to" issue links from current issue to issues in a project named CONTACTS with user picker custom field "Contact User" equal to current issue's Reporter. This is a typical usage for linking issues reported by a user, with its corresponding issue in a Jira project which is used as contacts directory:

Note that:

  •  %{00006} is field code for Reporter

Once configured, post-function looks like this:

We use JQL queries for selecting issues. The syntax is the same used by JIRA for advanced issue searching.

You can insert field codes with format %{nnnnn} in your JQL query. These field codes will be replaced with the values of the corresponding fields in current issue at execution time, and the resulting JQL query will be processed by Jira JQL Parser. This way you can write dynamic JQL queries that depend on values of fields of current issue.
Example: issuetype = "%{00014}" AND project = "%{00018}" will return issues in same project and with same issue type as current issue.

When you write your JQL for selecting the issues, take into account the following advices:

  • If field values are expected to have white spaces or JQL reserved words or characters, you should write field code between quotes (double or simple). Example: summary ~ "%{00021}" will return issues with current user's full name. As full name can contain spaces, we have written the field code between double quotes.
  • In general we will write field codes between quotation marks, since in most cases it doesn't hurt and it's useful for coping with field values containing white spaces or reserved JQL words. Anyway, there is an exception to this general rule: when our field contains a comma separated list of values, and we want to use it with JQL operator IN. In those cases we will not write the field code between quotes, since we want the content of the field to be processed as a list of values, not as a single string value.

    Example: Let's assume that "Ephemeral string 1" (field code %{00061}) contains a comma separate list of issue keys like "CRM-1, HR-2, HR-3". JQL Query issuekey in ("%{00061}") will be rendered in runtime like issuekey in ("CRM-1, HR-2, HR-3"), which is syntactically incorrect. On the other hand, JQL Query issuekey in (%{00061}) will be rendered in runtime like issuekey in (CRM-1, HR-2, HR-3), which is correct.