I am using Jira Premium and I also have Jira Workflow Toolkit for workflow validation. I have created a new issue type called 'Problem' and I have added a Parent Link field to the Bug issue type. So when I create a bug I want to validate that the parent link points to a Problem issue type but I can't figure out how to do that with JWT?
Can anybody help?
Hello @Paddy Walsh,
I am Vicente, a member of the Support Team of Decadis, and I will gladly help you to configure a JWT for Jira Cloud Jira expression validator to evaluate if the Parent Link field links an issue of a certain issue type and the current issue.
In order to do so, please, add the following expression to the Jira expression validator after replacing nnnnn with the ID of the Parent Link field and 10619 with the ID of the Problem issue type.
issue?.customfield_nnnnn?.data.issueType.id == "10619"
Some more use cases for our Jira expression validator can be found in our documentation, namely in the page Jira expression condition/validator (use cases).
Please, let us know if you need further assistance in this thread or via our Support Service Desk.
Best regards,
Vicente
Hi @Vicente Domínguez _Decadis AG_ ,
Thanks very much for your prompt answer.
When I use your suggestion in JWT and run the expression against an existing Bug with the parent already set it works (evaluates to true). However, when I try to create a bug in Jira and I supply the Parent Link it fails. What could I be doing wrong?
Oddly, this only seems to happen on issue creation - if I apply the same expression to a later transition it seems to work.
I am also finding it very difficult to figure out how to access values in the linked issue (linked by the Parent Link field which is a Jira-specific custom field). You use the prefix issue?.customfield_10018.data but how do I know what is in this data? For example, how can I test the status of the linked issue or how would I check the value of a custom field in the linked issue?
I want to do something like:
issue?.customfield_10018.data.customfield_10197 != null
but this resolves to true no matter what the 10197 field is set to in the parent issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, will JWT be able to handle the new changes proposed in Jira as described in https://community.atlassian.com/t5/Jira-Software-articles/Introducing-the-new-Parent-field-in-company-managed-projects/ba-p/2377758?utm_source=product-announcement-email&utm_medium=email&utm_campaign=jswc-june-round-up_EML-15302&jobid=106112748&subid=1725028522#M1320 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Paddy Walsh
Apologies, but this value does not seem to be available during the creation of the issue. I tested it in other transitions and, as you mention, was working as expected. I assumed beforehand that the behavior was the same in all the transitions.
Regarding your second question, the properties of a field can be examined by running an expression like the following one in our expression editor:
issue?.customfield_10018
It would only be necessary to replace the ID 10018 with the appropriate one to adapt it for any other custom field.
In this case, data is one of the available properties of the field, and we made use of it in our previous expression.
For your purpose, as there are no “status” property available for the field, the constructor new Issue() must be used to retrieve more information about the issue of the Parent Link field:
new Issue(issue?.customfield_10018.data.key).status.name == "In Progress"
If you are interested in which functionalities you would like to discover or see implemented in our app please feel free to open a ticket in our Support Service Desk.
Best regards,
Vicente
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vicente Domínguez _Decadis AG_ ,
Thanks very much - the new Issue seems to work - I assume it only create a temporary issue of some sort? I hope you don't mind if I ask one final question - if I use 'new Issue' can I perform several checks on that issue or would I need to do new Issue several times?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Paddy Walsh ,
For not using the constructor several times, the issue can be stored in a variable and evaluated, for example, as follows:
let evalIssue = new Issue(issue?.customfield_10018.data.key);
evalIssue.status.name == "Done" && evalIssue.customfield_10197 != null
Please, let us know if you need some more information.
Best regards,
Vicente
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vicente Domínguez _Decadis AG_
Thanks very much Vicente - that is all working well now - you have been a great help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.