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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,670
Community Members
 
Community Events
184
Community Groups

Jira Server Groovy: Check if issue was assigned via "Automatic" assignee

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 29, 2023

Hi all!

I'm trying to figure out during the issue creation screen, if the assignee field is:

  1. Automatic
  2. Unassigned
  3. Assigned

In any case, I have a script which needs to run only if an issue during creation has not an assignee (the reporter already placed/has chosen an assignee). So if the issue has on the assignee field the values "automatic" or "unassigned", then the script should run.

Keep in mind that automatic will assign the issues to the component leads or project default, based on the project configuration.

So far, I've played with transientVars which returns the modifiedValues only if the script was placed AFTER the issue create PF.

  • Inside the modified values when the issue had "automatic" as an assignee, the oldValue was null, whereas the newValue was the component lead.  <-- This is NOT OK
  • This was the same if the issue was assigned manually.  <-- This is OK
  • Only when the issue was unassigned, both values returned null. <-- This is OK

 

The only solution I've come up with is to create a behavior script, which will populate a CF with a value, is the assignee is a user. And then on my PF script I would check if that field is null or not. If it's null, then the script should run. 

Appreciate any advice on this matter :)

Thanx!

1 answer

1 accepted

2 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 29, 2023 • edited Apr 01, 2023

Edit 2: Found the solution:

ActionContext.getRequest().getParameter("assignee") will return -1 if automatic is chosen on assignee. The trick is to place the PF before the create issue post function.

Dave Liao
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 29, 2023

Woohoo!

Dave Liao
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 01, 2023

...that's a gem!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events