is it possible to call a built-in script via my own groovy script?

hi guys,

i want to automate the run of the "rename user id" built in script. given i have 10 people to rename or merge, i don't want to click and submit the script via administration user interface 10 times. i want to create my own script that gets the 10 users as parameter and calls the built in script 10 times.

i think calling a given script should not be a problem, however i'm a groovy newby and cannot solve my problem on my own without further research.

thank you!

steve

1 answer

1 accepted

3 votes

There are two answers... there is an undocumented (currently) rest API where you can call any script via a rest request, if you have admin permissions. I'll give you code examples for both of these but they are ugly code just lifted from something I may have been once working on, not exemplars at all.

So here is an example for copying a project using REST: https://gist.github.com/jamieechlin/5195423

You can also call them from a groovy script. Here is a one-off script for merging users whose names differ only by case. The bit you need is in the loop at the bottom: https://gist.github.com/jamieechlin/5195431

You might need to look at the script source to get the parameter names.

Method 2 is probably a lot easier depending on context.

hi jamie,

thank you for your fast response. this seems to be the thing i was looking for. :)

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,253 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot