Use case
Generate automatically a link to a JQL query that searches for issues based on information obtained from the current issue.
⚒️ Configuration
Create a new Calculated Text Field (by JWT) custom field and name it properly.
Providing a description will help you to identify what the custom field does but this step is optional.
Parsing mode
Set the Parsing Mode to Basic text
Parser expression
Add the following expression:
<a href="%{system.baseUrl}/issues/?jql=project=%{issue.project.key} and summary ~ '%{issue.summary}'"> JQL query for %{issue.key}</a>
This expression generates a query that retrieves issues in the same project and with the same summary as the current issue. Note that some special characters are not supported in this query.
Variant for single choice fields
This expression requires the replacement of the field code %{issue.cfaaaaa} and the name of the Select List (single choice) field with the appropriate ones.
<a href="%{system.baseUrl}/issues/?jql=project=%{issue.project.key} and 'Select List (single choice)' = '%{issue.cfaaaaa}'"> JQL query for %{issue.key}</a>
This expression generates a query that retrieves issues in the same project and with the same option in a Select List (single choice) field as the current issue. Note that some special characters are not supported in this query.
Variant for multiple choice fields
This expression requires the Advanced text parsing mode and the replacement of the field code %{issue.cfaaaaa} and the name of the Select List (multiple choices) field with the appropriate ones.
"<a href=\"" + %{system.baseUrl} + "/issues/?jql=project=" + %{issue.project.key} + " and 'Select List (multiple choices)' in (" + toString(textOnStringList(toStringList(%{issue.cfaaaaa}), "'" + %{seed.text} + "'")) + ")\"> JQL query for "+ %{issue.key} + "</a>"
This expression generates a query that retrieves issues in the same project and with the same options in a Select List (multiple choices) field as the current issue. Note that some special characters are not supported in this query.
Add the field to the relevant view screens.
Remember: All calculated fields are read-only and cannot be manually updated on a create or edit screen.
📚 Related use cases
| Title | Field type | JWT feature | Label |
|---|---|---|---|
| Check if an issue was resolved on time | Text |
(input latin letters) |
|
| Components from all sub-tasks |
(input latin letters) |
|
|
| Details of the last comment | Text |
(input latin letters) |
STAFF PICK |
| Difference between two dates in business days | Text |
(input latin letters) |
|
| Display additional details of the issue creator |
(input latin letters) |
|
|
| Display current issue's project category |
(input latin letters) |
|
|
| Display historic due dates |
(input latin letters) |
|
|
| Display reporters of linked Cloud issues | Text |
(input latin letters) |
|
| Google Maps location | Text |
(input latin letters) |
STAFF PICK |
| Highest ranked custom field value among all linked issues | Text |
(input latin letters) |
|
| Last comment, its author, and timestamp | Text |
(input latin letters) |
STAFF PICK |
| Last commenter's full name | Text |
(input latin letters) |
|
| Status and assignee of parent issue |
(input latin letters) |
|