Forums

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

How can we assign a component into two person in a based on workflow transition in jira?

R M November 4, 2023

Hello.

I have an essential question. I want to assign one component to the different persons of different statuses in a workflow. Components are selective and we have almost 200 components in a project and we want to associate one component to a specific person based on status in a workflow. In another status the component associates automatically to another person. 
I don't know what is the best way to create this rule, please let me know if there is a way by workflow automation and if is there any other solution.

Thank you,

Sincerely
Raziye

3 answers

2 accepted

2 votes
Answer accepted
Jack Brickey
Community Champion
November 4, 2023

Hi @R M , are you wanting to achieve this for all or most of the 200 components? This could become a real scaling issue if that is the case. With that said, I would simply create an automation rule that would trigger on transition and then use if then else condition on the components to set the proper assignee. If I were to understand more details of your use case, I might present a different approach.

R M November 4, 2023

Hi @Jack BrickeyJack Brickey,

Thank you very much for your guidance.
In our project, we have about 200 components for the project and we want each of these components to be automatically assigned to different people at different statuses/transitions of the workflow.

Please describe your proposed solution in detail.

 

Thank you,

Sincerely
Raziye

Jack Brickey
Community Champion
November 6, 2023

Hi @R M , how many different people/scenarios are we talking about? As I said previously it may not be scalable. For example, in the worst case scenario you would have 400 different users, 2 for each component. my suggested approach would not be possible in that case. However let's say you had 5 different scenarios:

  • 20 components assigned to Fred in Statuses A, B and then assigned to Sally in statuses C, D
  • 20 components assigned to Jack in Statuses A, B and then assigned to Joe in statuses C, D
  • Etc....

In that scenario it would be a reasonable approach.

My question is, why are you reassigning issues in this scenario? Maybe there is a better solution. Can you explain your use case?

R M November 6, 2023

Hi @Jack Brickey, Thank you for your guidance.

We have a complicated workflow in our company and we have almost 200 components. We want to assign components automatically in the specific transition to the persons. one component has to be assigned to the different persons in the workflow automatically. I could do this by creating components such as units' names like USSD-DEVELOPMENT and USSD-OPARATION and setting for each of them component lead and setting the post function to the automatic assignee to set at default assignee where we want in the workflow. But if we choose/set more than one component in the component field, we can't use this solution.
would you have a better idea? 

 

Best Regards, 

Raziye

0 votes
Answer accepted
David Fischer
Community Champion
November 7, 2023

Hi @R M ,

what do you mean by "assign one component to the different persons of different statuses in a workflow"? Do you mean that, during a transition, you want to assign the issue to a specific user based on the value of the issue's Component/s field? And is that the Component Lead of the selected component(s)?

If so, what do you want to do when more than one component is selected? Jira doesn't allow more than one Assignee to an issue. Select the lead of one of the selected components? Randomly?

R M November 7, 2023

Hello, @David Fischer Thanks for your guidance. 

Yes, I mean when I transition an issue I want to assign it automatically to a component lead. I don't have any idea when I select some components and how I can assign the issue's component leads to them.

Is there any solution for post-function rules?

Do you have any idea?

 

Best Regards,

Raziye

David Fischer
Community Champion
November 7, 2023

Hi @R M ,

you could use JMWE's Assign Issue(s) post-function : https://appfire.atlassian.net/wiki/spaces/JMWE/pages/462061817/Assign+Issue

But the problem remains if you have more than one component selected for the issue: which Lead should the issue be assigned to?

R M November 12, 2023

Hello @David Fischer 

Thank you for your guidance. 

Do you think is there any way to associate issues with the first component lead, when we select some components?

 

Best Regards,

Raziye

David Fischer
Community Champion
November 13, 2023

Hi @R M 

sure, you can use the aforementioned Assign Issue(s) post-function, select the "User returned from script" option, and for the script use:

issue.get("components")?.first()?.componentLead
0 votes
Amanda Culver
Contributor
November 6, 2023

For Clarity
A component  
is Project scope - 200 components, is that system wide, or an individual project ?
can have multiple values in a field in a Jira issue.

Meaning that a Jira issue has a field that has 0 or more values in the 'component' field

KEY : TASK-123
SUMMARY : Do something Amazing
Component : Green, Blue
Start date : 01 Dec 23
Due Date : 25 Dec 23
Story points : 9

In the project, the two different components have 'Leads'

Component = Green
Lead = Sally

Component = Blue
Lead = Joe

Essentially :
the component field is a multi value field
the Assignee is a single value field.

Given that a Jira issue can have multiple components in the component field, the automation would only be able to assign the Jira issue (TASK-123) to the Leads (Sally or Joe) of either the First or the Last Component. 

You're saying that on a WF transition, if the component field contains Green, you'd want the assignee to be set to Sally ... then on transition to a different status, if it contains Blue, you'd want the assignee to be set to Joe.

This would require either

* an automation (lots of if then elses)
* if you have scriptRunner, it's a post Function on the WF transition to run a script


 

R M November 7, 2023

Hello @Amanda Culver 

Thank you very much for your explanation that made the matter clear.

We have almost 200 components in one big project and what matters is that if we select multiple components in one component field it can't be assigned automatically. I don't know what is the best solution for implementing this procedure.

where can I add scripts in the JMWE workflow? I mean what is the best post function for it?

Best Regards, 

Raziye

Suggest an answer

Log in or Sign up to answer