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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Jira Cloud Scriptrunner - Find Issues that were moved from other Projects

Deleted user Jan 10, 2020

I recently stumbled over this Community Question:

I tried to run the Script, but it seams it would only work on Scriprunner for Jira Server

Since i am on Cloud and just starting to test Scriptrunner i wonder if somebody could help me get a working Script that gives me Issues that were moved from one specific Project to another specific Project for Scriptrunner Cloud.


Best Wishes


2 answers

2 accepted

1 vote
Answer accepted
Payne Rising Star Jan 10, 2020

Going forward you can configure a notification in the notification scheme for "issue moved".

Thanks for the Advice. I didn't think of that.

Best Wishes


0 votes
Answer accepted

Hi Michael,

Thank you for your question.

I have checked your requirement and can confirm it is not possible to use ScriptRunner for Jira Cloud to track the details of when a ticket is moved between issues and to post this information on an issue when it is moved.

The reason for this is that Atlassian does not provide a webhook that can be used to run code when an issue is moved using the built-in Move Issue functionality provided by Jira.

However, I can confirm that the closest thing you could do with ScritpRunner for Jira Cloud would be to configure a Script Listener which is configured to fire on the Issue Created event.

The listener code would then post a comment to the created issue with the original key of the issue so that you have this information documented on the issue when it is created and before it is moved to another project.

I can confirm that we have an example of how to add a comment on an issue when it is created inside of the documentation page located here.

You would then be able to search issues which have the comment added to see if the original issue key was from a different project.

I hope this helps.



Deleted user Jan 13, 2020

Hallo Kristian,

i think you missunderstood my Usecase. I want to find out which Issues were moved from one specific Project to another specific Project. I don't want to change or Comment on the Issues and i want to do it in retrospect.

Is it not possible to access History Data from Issues in Scriptrunner Cloud? I didn't find Examples so far.

Best Wishes


Hi Michael,

Thank you for your response.

I can confirm that it is possible to get the Change History for an issue by making a call to the Get Changelogs Rest API which Atlassian provides and is documented here.

Using this API you will be able to return the Change History from an Issue and you will be then able to write some logic check in the history returned if the issue has moved projects.

I have just created a small example located here which you can run on the script console in order to return the change history for an issue and you can use this as a reference guide to see how to use this API and to check in what in format the data is returned.

I hope this helps.



Hallo Kristian,

thanks for your Response.

Is there no other way, than to access all the Issues complete Changelogs?

def destProject = "AAA"

def result = get("/rest/api/3/search?jql=project=${destProject}&fields=summary&expand=changelog")
.header('Content-Type', 'application/json')

And then check each if the Key was changed?

The next Problem would be the Paging of the Search.

The Example in uses a ChangeHistoryManager Class. is that or something similar not available in the Cloud Version?

Best Wishes


Hi Michael,

I can confirm that the example linked above will not work on Jira Cloud due to the fact that the code provided inside of it is for ScriptRunner for Jira Server and this will not work as Atlassian only provide a rest API in Jira Cloud and do not provide a Java API in the cloud-like they do in Jira Server.

 Unfortunately in Jira Cloud, the only API to get the Change Logs is the one linked above as Atlassian does not provide another API where you can get the Change Logs for a set of issues specified.

This means that you will need to write some logic in your code to call this API for every issue key returned from your search in order to get the changelogs for each issue.

I understand this response is frustrating but please understand that this is the only way to get the Change Logs as this is the only API that Atlassian provide for this inside of Jira Cloud.

I can also confirm that for the Search API that Atlassian provides a maxResults parameter as described in the API documentation page located here which as stated in this page defines the maximum number of items to return per page.

I hope this helps.



Deleted user Jan 14, 2020

Hallo Kristian,

thanks for your Answer you saved me the time to look further before i start to code something.

Can i somehow save the Script within Scriptrunner, like the Built in Scripts or is the only option to copy it into the Console again?

Best Wishes


Hi Michael,

I can confirm currently we do not provide any ability to save scripts as a built-in script currently.

This means we would advise saving the script somewhere such as a Git repository and then to copy the code from here into the Script Console page each time you wish to run the script.



Suggest an answer

Log in or Sign up to answer

Atlassian Community Events