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

ScriptRunner - Need to bulk change / automate change of priority value of linked issues

Greg Williams November 3, 2021

Hi:

I'm new to ScriptRunner but we have a user who has given us an interesting scenario with which we cannot find a solution.

He needs to take all of the issues that are linked to a Project (CoE Reporting) and then any priorities that are Not Prioritized need to be changed to a P2 Priority.

After some research we found the following script to use in ScriptRunner (does not work in Atlassian standard JQL query):
issueFunction in linkedIssuesOf(Project ="CoE Reporting") AND priority = "Not Prioritized"

We get the results below:

JQL Linked Issues.jpg

Now we just need to change the Priority of these results into a P2 via automation and/or bulk change.

When attempting to use Jira automation it kicks it back as invalid.
When attempting to use standard issue filtering for bulk changing it kicks back the JQL as invalid

JQL Linked Issues-automation error.jpg

 

When looking at the Adaptavist library I got this possible solution to "Bulk Update the Value of a System Field on Jira Issues" but when I tried to use the script in the code on the automation it, too, returns errors because the script is apparently for Jira server, not cloud, but when I click on the link to learn more, I get a 404 error "page not found":
jira script import error server.jpg

 

I found this article on Bulk updating a CUSTOM field but not a system field. And it, too, looks to be for Server, not Cloud.

Is there a script that I can use to bulk change priorities in ScriptRunner, or is there some standard JQL alternatives to issueFunction and linkedIssuesOf?

2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 4, 2021

Hi Gregory,

I can confirm that you are correct that you cannot use the issueFunction keyword in regular JQL search boxes directly such as on the automation screen.

However, I can confirm you can reference the saved search from the enhanced search page by calling its filter in order to use the issues returned by it in places such as Agile boards or automation rules and I can confirm we have a knowledge base article located here which explains this.

Finally, I can confirm the page the link you mentioned should link to is the page located here.

I hope this information helps.

Regards,

Kristian

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2021

Hi Gregory,

I can confirm that we have now fixed the broken link on the Invalid imports popup and we thank you for bringing this to our attention and apologise for any inconvenience that this caused.

Regards,

Kristian

Like Greg Williams likes this
0 votes
Can Balık November 3, 2021

Thank you for the useful information.

TAGS
AUG Leaders

Atlassian Community Events