When a user (service desk agent) creates an issue, I have included the 'linked issues' field in the create screen. I want to make sure that the user has entered at least one issue in this field.
I am running JIRA Cloud, and have Scriptrunner available.
I have tried making the field mandatory in the field configuration scheme, but I think this only enforces the link type.
I have tried to set a validator in the workflow - 'Field Required Validator' but there is no 'linked issues' field in the list of possible fields.
I have tried to write a 'Scriptrunner script validator' in the workflow. I have used this expression: (issueLinkManager.getOutwardLinks(issue.id).length) ? true : false
... but this always returns false.
Can anyone help please?
Thank you for your question.
I can confirm that we have created the Knowledge Base article located here which explains how Script Validators work inside of ScriptRunner for Jira Cloud.
You will see in the Knowledgebase articlle that it shows that validators are defined using the Jira Expression Framework as documented in the Atlassian API documentation page located here.
We can confirm that when viewing the Jira Expression Framework API documentation page linked above you can navigate to the Context variables section which shows what variables are provided by this framework that can be used to create the expression.
If you then click on one of the variables it will show all the properties that can be called on the variable for the expression such as for the issue variable.
I can confirm when reviewing the properties available to the issue variable one of the properties as described in the API documentation is the
links property which contain the issue links for the issue and this is the property that you should look to check in your validator.
I hope this information helps.
Thank you for confirming that you have resolved your issue.
I can also confirm that I have come up with an alternative way to validate than an issue has at least one linked issue which is shown here and wanted to share this with you as well as a reference.
Hello Insight users, As part of our (Mindville's) acquisition by Atlassian, our training team is looking to build some new Insight training materials. It would really helpful if you can ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event