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

This widget could not be displayed.

Hi Hoan,

Which XML samples are you referring to?

You can find documentation about the product here: https://jamieechlin.atlassian.net/wiki/display/GRV/Script%20Runner

Documentation about JIRA api here: https://developer.atlassian.com/static/javadoc/jira/6.3.15/reference/packages.html

This widget could not be displayed.

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>

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

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


 

 

Look at com.atlassian.jira.security.groups.GroupManager and com.onresolve.scriptrunner.canned.confluence.utils.UserUtils

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

This widget could not be displayed.

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 Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

509 views 3 18
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