How can I reference the Component Lead in a JQL?
Asked by Santino Lucca Castrataro:

Hi! I?m struggling to reference the Component Lead in my JQL queries. I tried this *project = GI AND componentLead != assignee* but the **componentLead** part has an error.

Can someone help me?


Answers:
author: Jack Brickey
body: Hi [@Santino Lucca Castrataro](/t5/user/viewprofilepage/user-id/5384791) , there is not a JQL function for the Component lead. could you explain your use case and your end goal so that we could see if there's a different way to achieve it?

comments: author: Santino Lucca Castrataro
body: Hey Jack! Thanks for your answer! Sure, my client needs to change the component lead every N time. And with this change, all the issues must have their component lead as an assignee, I?m actually using that JQL in a branch so I can use the "Assign Automatically" function in the issues where the assignee and the component lead is different.

Thanks again!


author: Jack Brickey
body: A couple of comments.

Warning: Keep in mind that Components is multi-select so you could have more than one component listed which can compromise intended component lead assignment. Just an FYI here. As an alternative you could create a single select 'component' field but this would not come with the component lead association.

You could use Automation to ensure that the Assignee gets updated when the Component (or new custom field if you go that direction) changes. However, this would be static, meaning you would need to code the leads into the rule and update when leads change. ??

One idea you could try...

Create an automation rule that triggers any time the component field is changed. You can add any condition necessary to qualify your rule, such that the action only runs when you want it to. However, you might not need a condition at all. The action would be to set the assignee automatically. As a prerequisite to this rule, you need to ensure the following:

* every component needs to have a component lead
* the default assignee is the component lead for each component

In theory, this should ensure that the Assignee follows the component field. However, recall the initial warning on multiple components. If you test this out let me know your results.


author: Santino Lucca Castrataro
body: I think that is not usefull for me at all because we don?t update the "Component" field because it represents a physical zone. Each issue has an adress and the place where is located will always be the same.

We need to only update the assignee because they distribute their work in zones. Each zone has an assignee, and every certain time they rotate the assignee of each place.


author: Jack Brickey
body: Given what you have conveyed I would not use Components but rather a custom field "zone" and automation to assign/reassign based on that field being updated.


author: Santino Lucca Castrataro
body: But I need to assign each issue to the Component Lead... If I use a custom field I would not be able to assign easily each issue when the assignee must be changed. Of course I can create an automation that depending on the value of "zone", I assign a different user, but it?s not what we want.


author: Jack Brickey
body: My proposal is to not use the Component field at all but rather create a custom field 'zone'. You might even consider a cascading field (though not required) where the first level is the Zone and the second level is the zone lead. The second level would be a single value always and default to the value.

example:

++zone \> lead++

USA \> Fred

Australia \> Mick

Germany \> Hans

This means a process change requiring the user to set the Zone at creation and change as required. The automation would set assignee based on zone field.

this may not be what you want but just offering an alternative.


author: Santino Lucca Castrataro
body: Great Jack, now I understand your idea better. I will accept your response because it?s totally valid, but we can?t actually do that because the project is almost finished and we are not able to change this now.

Anyway, thanks for your answer!


author: Jack Brickey
body: Understand. Unfortunately the component lead approach just isn't going to work at least through automation. I guess that whenever they change the component lead, they will have to do a JQL search for all issues with that component and perform a bulk update.


author: Steve Y
body: [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369) - I do have a use case behind the OP request. Trying to create a filter for a KanBan board that allows a 3rd party to do a filter query similar to "Only My Issues", based on the component lead. Acceptable alternative might be to present a query box to enter a name.

comments: author: Steve Y
body: This makes me wonder if using Assets to hold the people who would serve as Component Leads. This begs the question, then... Can an Asset Object be a Component Lead?


Tags: cloud

jira-work-management-cloud