script runner jira

Hoan Pham February 25, 2015

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

0 votes
Hoan Pham March 4, 2015

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.

0 votes
Hoan Pham February 26, 2015

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>


 

 

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2015

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

Hoan Pham March 3, 2015

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

0 votes
Alejo Villarrubia [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 26, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events