Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation for JIRA - can I assign issue to component lead if it's unassigned?

Nofar Ben Kereth
Contributor
March 8, 2020

Hey, 

 

I'm trying to create a rule that assigns issue to it's component lead ONLY if it's unassigned. I know I can auto-assign to component lead from the projects settings. But I want to do so only if the issue is currently unassigned. Tried to find a smart value but no success there. 

 

Thanks

Nofar

3 answers

3 votes
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2020

Hi @Nofar Ben Kereth

During creation, this is how the component lead works - it defaults to the component lead unless a specific user is selected.

I think I've worked out a way during edits - it does require a little setup:

  • Ensure each required component has a component lead
  • Ensure the default assignee is the component lead for each of those

^ Once done, create an automation rule and then:

  1. Set a Trigger - for example, Field Value Changes > Assignee
  2. Set a Condition, specifically a User Condition. You want it to check Assignee and that user is empty / unassigned
  3. Set an Action, specifically Assign Issue - select the option "Automatic"

This should default unassigned issues to the Automatic assignee - in this case, the Component Lead. 

You can use another Trigger if you prefer, such as any time the issue is edited or transitioned. This was just the one I used for this test.

Ste

0 votes
Jan Schneider
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 29, 2021

Hi @Nofar Ben Kereth

 

first, you should check if the field "assignee" is empty with a condition component.

Getting component leads is a bit more difficult. You can call the Jira API to get the component lead (documentation). I found this tutorial quite helpful to follow for basic setup, which makes it quite easy.

 

I think you should get the component lead accountId then via the webhook response like this:

{{webhookResponse.body.lead.accountId}}

 

Which you can use in the automation component "assign issue" in which you select "smart value" any copy paste the above smart value in.

 

And you can upvote the feature request in the meanwhile: https://jira.atlassian.com/browse/JRACLOUD-76851

 

Yours
Jan

Oleksandr Sokolovskyi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2023

For people from future.

 

{{webhookResponse.body.lead.accountId}} 

eventually became

{{webResponse.body.lead.accountId}}

 

Also, in my particular case the flow looked like this:

1. If field changes on some condition.

2. Set Component = X

3. Send API request to get the lead of Component = X

4. Assign the issue to the lead of Component = X

 

All my issues remained unassigned. This checkbox in the point 3 solved it:

Delay execution of subsequent rule actions until we've received a response for this web request
0 votes
Sivarama Krishna K
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

Hi,

A little workaround to be done to avoid any trigger.

First, the whole system to be disabled to unassigned issues.

System --> General Configuration --> Allow unassigned issues --> OFF

To enable this in System, you need to make sure no unassigned issues.

 

At project level, you are anyhow setting default Assignee as Project Lead. If component is selected, then Component Lead.

 

For any of the issue created, it will be assigned to ASSIGNEE or Component Lead or Project lead.

 

Hope this works without adding any triggers.

 

Regards.

Suggest an answer

Log in or Sign up to answer