Hello everyone !
I have a problem trying to exclude some project from a transition using conditional execution with Jira misc workflow extensions (jMWE).
I have a workflow shared with multiple project and multiple issuetype and I want to implement a condition that :
- If the issuetype is Bug and project is not part of Project "A", "B", then transition issue to In Progress
Issuetype = Bug and project != ("A","B")
So the transition will apply to project C but not A and B
I have tried so many things but nothing is working correctly, it even have reopened some of the issue
Here is my last attempts :
{{ issue.fields.issuetype.name == "Bug" and issue.fields.project.key != ("A" , "B", "C") }}
I don't know what i'm missing here if someone could help please.
Thank you !
Have a nice day
@Joseph Hani You can try this:
{{ issue.fields.issuetype.name == "Bug" and issue.fields.project.key not in ["A","B"]}}
Hello @Sayed Bares _ServiceRocket_
Thank you for your suggestion. At first, I thought it could work, since I haven't try the "not in" between projet.key and the list...
But still it's not working. I tried to create issue in project A and immediately transition to In Progress ... :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joseph Hani can you share a screenshot from your post-function? if you test your nunjucks code against your issue does it return true or false? do you see any error in your JMWE logs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
are you sure you replaced "A" with the project key and not name?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @David Fischer / @Sayed Bares _ServiceRocket_
Yes I'm sure it's the KEY and not the name of the project.
Here is a screenshot of the post-function (with my try)
I tried to create a ticket inside "ORDER" and the ticket transition automatically to In Progress.
I'm kind of lost here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well ... It seems that I have forget to add "[]" ... I test again, correcting my mistake and now it's working perfectly !
I don't know what to say sometimes you just miss your comma, sometimes it's the hooks ...
Thank you very much for your help !
Have a wonderful day !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joseph Hani Thank you for posting how you figured this out. I was having the same issue today - could not figure out why my expression wasn't working as expected, and your post helped me realize that I'd used parentheses instead of brackets. Thank you again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Joseph Hani,
I'm not sure about difference in JMWE features for Cloud and Data Center, but I'd use this for my data center instance. Try this:
issue.get("issuetype")?.name == "Bug" && !(issue.get("project")?.key == "A" || issue.get("project")?.key == "B")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Kseniia Trushnikova
Thank you very much for your proposition, it seems that we have found the solution. I have tried yours, but I think it's not working the same way from DC to Cloud !
Have a nice day
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.