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

how to access the component lead name when transitioning an issue

Rudd February 18, 2014

We have a custom field named "Assigned Lead", which may or may not be the same as the defined "Component Lead" in JIRA. When an issue is submitted, I want to change the "Assigned Lead" to default to the "Component Lead" (the real Component Lead could reset this later). Is there a way to get at the Component Lead name? I can, using the Jira Suite Utilities get the %%CURRENT_USER%% value, but that could be any one.

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Sebastien Delcoigne
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.
February 18, 2014

I haven't looked into detail but the Jira Suite Utilities adds post functions to copy the value a field into another or to update customfields. This should do it for you.

Simply add the post function to the proper transition in your workflow.

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2014

I don't think you read the question we need to get component lead not the component name.

Rudd February 21, 2014

I'm marking this as answered, because we ended up using the process as described below. It isn't exactly like we wanted, but it is close enough.

0 votes
Stephan Bielmann
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.
February 20, 2014

It would sure be possible to extend JSU for this use case, however the Component/s field lets you choose more than one single component, which means there would be more than one lead possible which makes the outcome of the post function not really deterministic.

Rudd February 21, 2014

interesting point... how does JIRA do it when creating an issue? You can set the default assignee to the Component Lead on creation. I am guessing they just take the first one and use it.

MattS
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.
February 21, 2014

It's a bit more complex than one might imagine. From an internal ServiceRocket blog post by Mikey Schott:

"Basically, when you use Automatic Assignment in JIRA with multiple Components, JIRA looks for a "Component Lead" assignment logic and uses the first one it finds alphabetically, and if there aren't any then it looks for a "Project Lead" assignment logic, and if there aren't any it looks for an "Unassigned" assignment logic, and if there aren't any, uses the Project Default."

0 votes
Rudd February 19, 2014

I think we can do this as a post event as described by Sebastien. First we setup the project to make the default Assignee as the Component Lead. then as a Post Event when the issue is created, we will copy the Assignee to the custom field "Assigned Lead". Since we are doing this as the issue is created, it should be okay, which is the only time the Asignee is guaranteed to be the Componant Lead. If we have to get the Component Lead later in the workflow, then we will have to look at the groovy script runner.

0 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2014

See here to update custom field value in post funtion -

https://answers.atlassian.com/questions/211505/updating-a-custom-field-using-groovy-script-runner

and use this to get component lead -

issue.getComponentObjects().getAt(0)?.getLead()

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events