I'm trying to require the new Parent field on the Create screen only for bugs and stories. I'm using JMWE on the Create transition. My JQL condition is:
(!!issue.issueType && issue.issueType.name == "Bug") || (!!issue.issueType && issue.issueType.name == "Story")
Whether you put a value in the Parent field or not you get the validation message that Parent is required. I thought I had this working like this last week and now it doesn't work. I've looked through the logs and no errors or anything is being reported.
The Story issue type shares a screen with other issue types so I can't just make the Parent field required in the field config.
Is there a problem with this new Parent field not working with JMWE? Am I just missing something and I don't have the condition right?
Hi @Lori Milam
First of all, your conditional validation script is not JQL but a Jira Expression.
In any case, I believe the reason the validator stopped working is because Atlassian released a major change to Jira around issue hierarchies.
Can you try using a Build-your-own validator with this expression:
issue.issueType.name != "Bug" && issue.issueType.name != "Story || !!issue.fields.parent
Here is my Build-your-own validator and it still acts the same way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lori Milam
The expression I provided is meant to be the full Jira expression, with no conditional validation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using your expression throws an error on issue.fields.parent . I changed this to issue.parent to get past the error and it still acts the same, throwing the validation error even when a parent is selected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lori Milam
my apologies, I made a mistake. The correct Jira expression would be:
issue.issueType.name != "Bug" && issue.issueType.name != "Story || !!issue.parent
(I confused Jira expressions and Nunjucks)
However, the documentation for Jira Expressions clearly states that "During issue creation, only available in workflow validators for subtasks in company-managed projects." This means that, at least for now, you cannot use a Validator to enforce a parent issue except for sub-tasks, and you cannot check anything on the parent issue either. This is a Jira Cloud limitation; you should contact Atlassian support to complain about it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @David Fischer that would answer my question why this isn't working. And since I can't find a way to make a standard field required in the field configuration (unless you know) I guess I can't fulfill this request. I definitely will be entering a ticket for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome @Lori Milam !
Probably simpler to write the JQL like so:
issuetype in (bug, story)
Hopefully this works for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That works too, but what I believe is really the problem is not recognizing that there is a value in the Parent field. This part of the JQL works fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @Lori Milam ,
Great. Possibly there could be an issue with JMWE. Maybe it would be good to share the screenshot of the configuration to see where the configuration might be an issue.
If indeed a bug, a short term workaround is to just make the field required in the field configuration and tied that field configuration to bug and story issue type. Although, It will be applied throughout the workflow and screens and not just the create screen and transition.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.