Groovy Script question

I want to write a groovy script that

Connects to dev JIRA.

Then search for issues, which their summaries contains the word "groovy"

If it exists, output the list of issues by issue key and Summary.

Otherwise, create an issue of that Summary: Issue from Groovy. And description ticket from Groovy.

So can any give me some idea or kick start.

2 answers

JIRA Command Line Interface can do most of this automatically and you can drive it from a groovy script if you want.

getIssueList will do the first part with the right JQL query. Then the otherwise part is just: createIssue

Can you please give me some kick start for connecting jira. using groovy script

def cmd = "/sde/atlassian-cli-3.5.0/atlassian jira --action getServerInfo"

def process = cmd.execute()

println "return code: ${ process.exitValue()}"
println "stderr: ${process.err.text}"
println "stdout: ${}"

The above used the Atlassian Command Line Interface distribution. If you use the JIRA Command Line Interface distribution then replace the command with something like

def cmd = "/sde/jira-cli-3.5.0/jira --action getServerInfo"

Hey Bob, I am using Groovey Script Runner and I have tried above script in my Jira. But it is giving me an error that

"javax.script.ScriptException: Cannot run program "/sde/jira-cli-3.5.0/jira": CreateProcess error=3, The system cannot find the path specified"
So what is the solution over that?

The example references a file path on your server. You need to reference the directory on your file server that contains the JCLI distribution that you installed.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


125 views 0 3
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