how to assign an issue based on information gathered from the history
Asked by Antonio Cal?:

I would like to assign an issue based on information gathered from the history when there was a state transition (in the past).

For example, in the issue history I see:

*Mr White changed the Status 3 days ago*

*STATUS 1 \>* *STATUS 2.*

Today the issue is in STATUS 5 and through a rule I'd like to assign the issue to Mr White and also move issue in STATUS 1

Mr White is not a reporter

Mr White is not an assignee

Can you give me support to implement the automation?


Answers:
author: Mykenna Cepek
body: Hi [@Antonio Cal?](/t5/user/viewprofilepage/user-id/4642353) and welcome to the Atlassian Community. Your question was an interesting challenge, and I enjoyed learning more about Automation while looking into it.

The solution below works in Jira Cloud.

I was able to pull the changelog for an issue in Jira, locate a user who made a change, and use that information to reassign the issue -- all within Jira Automation.

You can certainly do this kind of thing from the Jira API itself (or with the help of Jira apps). But I like to keep things in standard Jira Automation, if possible.

Here is an overview of my test rule, focusing in on the key magic to pull out the accountId for a user (arbitrarily the user who made the first/oldest change, just to keep things simple):

![Changelog Assign 1.png](https://community.atlassian.com/t5/image/serverpage/image-id/175212i212B98BE2ABAE6EC/image-size/large?v=v2&px=999 "Changelog Assign 1.png")

Tip: you can inspect the {{webResponse}} object after the "Send web request" action, in order to understand the data that is being returned. Use the "Log action"component, or even send it as an email or Slack/Teams message to yourself.

Learn more about iterating lists and accessing nested data [here](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/).

And here is the audit log for this rule after 2 runs, showing successful reassignment during the first run:

![Changelog Assign 2.png](https://community.atlassian.com/t5/image/serverpage/image-id/175213iA7C80D1BCEF80DC3/image-size/large?v=v2&px=999 "Changelog Assign 2.png")

I'll leave the remaining logic to you. It's not clear to me how you plan to identify the user who should be assigned to this issue, based on the data in the changelog. But all the information is there.

Note that, at this time, using Web Requests in Jira Automation is seen by many as being somewhat insecure, due to the need to embed credentials for API authentication in the rule. If you trust all your Jira admins, the risk is minimal.

Good luck!

comments: author: Antonio Cal?
body: Thank you [@Mykenna Cepek](/t5/user/viewprofilepage/user-id/3527113), your answer gave me a good idea.

I talk to the Jira admin about it and try it out.

Kind regards,

Antonio


author: Bill Sheboy
body: Hi [@Antonio Cal?](/t5/user/viewprofilepage/user-id/4642353) -- Welcome to the Atlassian Community!

What problem are you trying to solve by doing this? Knowing that may help the community to offer suggestions.

As Nic notes, you cannot currently use automation functions to directly access the issue history (other than an elaborate work-around calling the REST API).

Depending upon your use case/need, it may be easier to save the user who made that status change when it happened with {{initiator}} with one rule, and then use that information later for the assignment in a different rule.

Kind regards,  
Bill


author: Nic Brough -Adaptavist-
body: Automation does not have the function you need to be able to read the history like this. I think you'll need one of the scripting apps to do this.