Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Our Jira has multiple Projects using the same workflow. Some of the Projects don't want to use the Project Lead as the Default Assignee. How can I add a post function to change the Default Assignee from the Project Lead to a Developer based on the value of the Project field? I tried to create a post function using "Assign to role member (JMWE app)", selected "Project Role = Developers", selected "Only if condition is true" but I'm lost after that. Not sure how to proceed. Can someone help? I'm basically trying to perform:
If Project = "ABCDEF"
then Assignee = Developer
else Assignee = default
Thx,
Jeff
Hi Jeff,
I can try to help you but I first need some clarification.
When you say that, for certain projects, you want to assign the issue upon creation to a "Developer", what do you mean by that? Any member of the Developer project role (chosen pseudo-randomly)? A particular developer for each project?
And for the other projects, who should be the assignee (i.e., what should the "default" be)?
Hi David,
By Developer I mean the Developer assigned in "Users and Roles" in "Project Settings" for a particular Project. I realize there could be more than one Developer but I only plan on assigning one Developer to Projects that don't want the Project Lead as the default assignee. I wish there was an additional option to select a default assignee other than the Project Lead. :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See Kat's answer below. Wouldn't that work for you? If not, you can certainly use the Assign to Role Member post-function with a conditional execution script like:
issue.get("project").key in ["ABCDEF","GHIJK"]
which will override the assignee. However, you might need to move the post-function to after the "Create the issue originally" post-function or Jira will override the post-function.
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.
Hi David. I received a second request to set the Default Assignee, in my case the Default Assignee2 role, only if the Issue Type = Bug. My current post process function which works great is (and thank you again for this):
Assign the issue to the default user from the Default Assignee2 role.
Run this post-function only if the following condition is true:
issue.get("project").key in ["Project1"]
I tried adding this to set the Default Assignee2 role only if the Issue Type = Bug:
Assign the issue to the default user from the Default Assignee2 role.
Run this post-function only if the following condition is true:
issue.get("project").key in ["Project1"] and issue.get("issuetype").key in ["Bug"]
This does not work though. I tried a number of different formats to get it to run using Issue Type but have not had any success.
You're guidance on this would be greatly appreciated.
Also, is there a good wiki on using these conditional execution statements in Post Processes? I haven't been able to find any good documentation so far.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff,
JMWE uses the Groovy language as its scripting language, therefore the "logical and" operator is written as &&. Also, .key will return the "key" of an object - here you seem to want to test the name instead. Try this:
issue.get("project").name in ["Project1"] && issue.get("issuetype").name in ["Bug"]
As for documentation, you could start with this: https://innovalog.atlassian.net/wiki/spaces/JMWE/pages/133562414/Customizing+further+with+Groovy+scripts and in particular https://innovalog.atlassian.net/wiki/spaces/JMWE/pages/151191769/Groovy+tutorial
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Once again David Fischer, thank you for your help! This works perfectly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The setting that controls the default assignee is not held in the workflow. Check out the Roles section of the project settings. You can chose the relevant default assignee for each project without impacting the workflow or needing a post function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kat.
Unless I'm missing something, Jira only allows the Project Lead to be the Default Assignee. Otherwise you have to set the Default Assignee to "Unassigned".
As I mentioned in my question, we want to be able to set someone other than the Project Lead as the default assignee based on Projects that use the same workflow. I don't see any way to do that through "User and roles" in "Project settings".
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.