Forums

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

Can I use Component Lead to fill in custom user picker in automation?

Martin Rodriguez July 3, 2023

I want to set a custom single user picker field (Reviewer) to the issue's Component Lead, as our reviewer are our component leads so Reviewer is automatically set at issue creation (can't add it from import, seems to always fail).

Is there a way to get the Component Lead user to use in an automation?

  • {{issue.components.XXXX}} is always empty when I try with "assignee", "leads", etc. and i don't know if there is a smart value I can use for:
{
"fields": {
"Reviewer": "{{issue.components.????}}."
}
}
  • The custom user picker doesn't let me set or copy from Component, only other issue types (parent, Epic, current issue). I guess Components are not issues.

I tried saving the initial assignee, re-assigning the issue to AUTOMATIC (component lead), setting the reviewer to copy from assignee and then re-set set the assignee to the original, but its a convoluted way to get the component lead user.

1 answer

2 votes
Mikael Sandberg
Community Champion
July 3, 2023

It can be done, you would have to use the Get component REST endpoint to get the component lead. {{issue.components}} will give you the ID of the component. Note that your automation needs to check if there are more than one component since the field can have multiple values.

Martin Rodriguez July 3, 2023

 The way we have it set up, an issue won't have more than 1 component. 

However, I don't really know how to use the Get Component REST endpoint as you say. My knowledge of automations is rather limited. 

Mikael Sandberg
Community Champion
July 3, 2023

In it's simplest form the automation would look something like this:

Screenshot 2023-07-03 at 12.48.16 PM.png

Screenshot 2023-07-03 at 12.48.26 PM.png

Note that you should encode64 the credentials in the webhook and/or make it hidden once you verified that it is working.  

Martin Rodriguez July 3, 2023

I tried to emulate what you showed and investigated some but couldn't make it work.

Darryl Lee
Community Champion
July 3, 2023

Hello @Martin Rodriguez -

If you can screenshots of what you've tried and any error messages, that's helpful for troubleshooting.

But for a good tutorial on how to connect Automation to the REST API (including a little more details about the authentication and encoding bit, which is a bit of a hassle), I would recommend checking this out:

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events