script runner jira

Hi, I followed the instruction to activate the script runner, but still struggling with the xml samples. I may miss some important info, please help.

Also where can I find documentation about the JIRA classes?

Thank you.

Groovy samples run ok:
import com.atlassian.jira.ComponentManager
def projectManager = ComponentManager.getInstance().getProjectManager()
def result="";
def pcount=0;
for(p in projectManager.projects) { pcount ++; }

result = "Project count:"+pcount
return result;

3 answers

Hi Hoan,

Which XML samples are you referring to?

You can find documentation about the product here:

Documentation about JIRA api here:

Thanks for your reply.

Basically, I would like to create an automation process to create groups, create users, then assign users to groups. Those xml I tried are:

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib">
<jira:CreateGroup group-name="jelly-group1"/>

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib">
<jira:CreateUser username="jelly-user1" password="passord1" confirm="passord1"
fullname="jelly-user-001" email=""/>

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib">
<jira:AddUserToGroup username="jelly-user1" group-name="jelly-group1"/>



Look at and com.onresolve.scriptrunner.canned.confluence.utils.UserUtils

The xml scripts above are not working. How can I run them as xml?

I am going to use groovy and JIRA api. No need for xml anymore. You can close this case. There are many good examples for groovy. Thank you Jamie for the script engine and samples smile.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

439 views 8 26
Read article

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