Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Change Default Assignee for Jira with multiple Projects using the same workflow.

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

2 answers

1 accepted

0 votes
Answer accepted

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. :-(

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. 

Thanks David.  That did the trick!

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.

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

0 votes

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.

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".

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you