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.
Community moderators have prevented the ability to post new answers.
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.
I don't think you read the question we need to get component lead not the component name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.