...
Panel borderColor black title Check for the number of linked issues If you know that the current issue cannot have more than one issue linked to it through the link type configured on the "Link to new issue" option, then you can identify the existence of the issue similar to the one being created by checking for the number of issues linked to the current issue with the specific link type.
Steps to follow:
In the Conditional execution section of the post-function write the following script
Code Block {{ issue | linkedIssues("caused by") | length == 0 }}
The post-function will execute only when there are no issues linked to the current issue through the "caused by" link type.
Panel borderColor black title Check for the number of linked issues and specific characteristics of the created issue If you know that the current issue can have more than one issue linked to it through the link type configured on the "Link to new issue" option, but has unique characteristics, such as the same Summary as the current issue, then you can identify the existence of the issue similar to the one being created by finding an issue linked to the current issue with the specific link type and Summary same as the current issue.
Steps to follow:
In the Conditional execution section of the post-function write the following script:
Code Block {% set pass = false %} {%for i in issue | linkedIssues("causescaused by") %} {% if i.fields.summary == issue.fields.summary %} {% set pass = true %} {% endif %} {% endfor %} {{ pass }}
You can also use the
searchIssues
filter to find the issue having characteristics similar to the issue being created.Code Block {{("project = Test and issue in linkedIssues(" + issue.key+ " ,causes'caused by') and summary ~ " + 'issue.fields.summary') | searchIssues | length == 0 }}
The post-function will execute only when there are no issues linked to the current issue through the "causescaused by" link type and with a Summary same as the current issue.
Panel borderColor black title Set an issue entity property and run the post-function based on its value Another approach is to set an issue entity property the first time the transition is run, and verify its value in the conditional execution of the post-function.
Steps to follow:
In the Conditional execution section of the Create issue post-function write the following script:
Code Block {{ issue | issueProperty ("New issue created") == null }}
- Add the Set entity property post-function to the same transition.
- Set the Current issue property,
New issue created
toYes.
- Add a 3 sec delay to this post-function.
The post-function will execute only when the current issue does not have an issue entity property with key "New issue created".
...