Forums

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

Jira premium automation

BenWade
Contributor
November 22, 2023

Hi everyone,

could someone help me to automate this process:

if reporter = assignee and status = UAT and status changes to DONE, change the assignee to the one that was when the status was either Development or In progress?

 

example:

 

Alex creates a ticket for Max

 

status = to do 

reporter = Alex

assignee = Max

 

Max works on it

 

status = UAT

reporter = Alex

assignee = Alex

 

Alex checks the dev

 

status = DONE

reporter = Alex

assignee = Max

then switch back to Max (so that the ticket can be counted as solved by Max, not by Alex) - can it be done automatically?

1 answer

1 accepted

1 vote
Answer accepted
Ste Wright
Community Champion
November 22, 2023

Hi @BenWade 

This can be done, but you likely need another custom field to store the user who worked on it during Development/In Progress to refer back to.

In summary, this would involve...

  • Creating a User Picker (single user) - eg. Developer
  • Using an Automation Rule to populate "Developer" when an issue transitions to Development/In Progress
  • Using a second Automation Rule to set Assignee back to "Developer" when the issue is closed

If you'd like more specific instructions on how to set this up, let us know!

Ste

BenWade
Contributor
November 22, 2023

I think I am close to solving this puzzle. Only the last step is needed. It should check who was assignee when the status of the issue was 'Development' or 'In Progress' and put him back as assigneimage.png

Ste Wright
Community Champion
November 22, 2023

Hi @BenWade 

That's what the "Developer" field in my original answer is suggesting - you could set it to be the "Developer", but only if that field was previously populated during the In Progress/Development transition.

Ste

Like BenWade likes this
BenWade
Contributor
November 22, 2023

To be honest, I do not want to add an additional field. We have so much things going on.

I think I just need JQL that can solve this issue.
I have come up with this code. will try it rn:


 

history.assignee != reporter AND (history.status = "Development" OR history.status = "In progress")
Ste Wright
Community Champion
November 22, 2023

Hi @BenWade 

I'm not sure there is JQL which will solve this issue - JQL searches for issues and provides them as a list, rather than finding specific historic issue parameters.

The suggestion I've provided is probably the simplest one. Otherwise you could try sending a web request to the API to recall the historic assignee, but I think that could get quite complex.

Ste

Like BenWade likes this
BenWade
Contributor
November 22, 2023

@Ste Wright You are correct, Stephen. I will follow your advice. Thank you fro your help.

 

Could you please maybe send me screenshots of the two automation flows that have to eb created? Would be nice if you make step by step guide.

Ste Wright
Community Champion
November 23, 2023

Hi @BenWade 

That could be quite a few screenshots! I'll write it down in the first instance :)

---

Prerequisites

Create a custom User Picker field, to do this...

  • ...in a Company-managed Project:
    • Go to Settings (cog icon in top-right) > Issues
    • Select Custom Fields from the left-hand menu
    • Create a custom field, type "User Picker (single user)"
  • ...in a Team-managed Project:
    • Go to Project Settings > Issues (left-hand menu)
    • Select the relevant Issue Type
    • Drag a "People" field from the right-hand menu onto the Screen
    • Restrict it to a single user
    • Then save the changes

Notes:

  • You can use a global custom field (i.e the first one) in a Team-managed Project also.
  • I've assumed you're using a global custom field for the rule below - these rules might differ if it's a Team-managed field.

---

Rule 1

Assign Developer when the issue transitions to "In Progress"

  • Trigger: Issue Transitioned
    • To Status = In Progress
  • Condition: Issue Fields Condition
    • Field = Assignee
    • Condition = is not empty
  • Action: Edit Issue
    • Field = Developer
      • Value = COPY FROM
        • Issue to copy value from = Current Issue
        • Field to copy value from = Assignee

---

Rule 2

Next, we'll assign the issue to the Developer if the status is UAT, and Reporter = Assignee:

  • Trigger: Issue Transitioned
    • From Status = UAT 
    • To Status = Done
  • Condition: Issue Fields Condition
    • Field = Assignee
    • Condition = equals
    • Field = Reporter - change tab from Value to Field
  • Action: Edit Issue
    • Field = Assignee
      • Value = COPY FROM
        • Issue to copy value from = Current Issue
        • Field to copy value from = Developer

---

A few notes:

  • COPY FROM is available through the breadcrumbs (...) in line with the field. You can then click on the text to fill in the "copy value from" details.
  • I've used the Edit Issue Action rather than Assign Issue, so the COPY FROM function can be used.

---

Let us know if this works!

Ste

Like BenWade likes this
BenWade
Contributor
November 23, 2023

Dear Stephen,

Thank you a lot for your detailed explanation. 🙌🙌🙌

Like Ste Wright likes this

Suggest an answer

Log in or Sign up to answer