Tutorial for script runner

Anyone know where to find a tutorial on script runner?  It looks like exactly what we need but being new to JIRA.

2 answers

now I am opening above link, but page does not exist, anybody can help me?

It's nearly 3 years old, and people have moved on.  Have a look at the SR docs and search this community for what you're trying to achieve.

Hi Nic Brough ,

Thanks for reply,

Now I am able to looking script runner in jira.

But I need help for the retrieve issue id using scriptrunner

Could you please help me when you get free time

How you retrieve an issue id depends on where you are running the script.  If it's in the console, you'll need to use an issueManager to fetch the issue.  If you're in a transition then the object simply called issue is immediately available to your scripts, and so-on.

Thanks Michal, but I was looking for something a bit more basic (Start me with a hello world :). Being new to JIRA, I do not even know where to start. I started writing plugin but that will take some time and to solve the immediate need of having a script that will automatically put the project into the correct component. Cheers...

When I try to run any example I get every line as an error: Error!startup failed: Script1.groovy: 1: unable to resolve class ComponentManager @ line 1, column 18. ComponentManager componentManager = ComponentManager.getInstance() ^ Script1.groovy: 2: unable to resolve class User @ line 2, column 6. User remoteUser = componentManager.getJiraAuthenticationContext().getUser() ^ Script1.groovy: 3: unable to resolve class MutableIssue @ line 3, column 14. MutableIssue issue = componentManager.getIssueManager().getIssueObject("DTT-1757") ^ Script1.groovy: 4: unable to resolve class Project @ line 4, column 9. Project project = issue.getProjectObject() ^ Script1.groovy: 5: unable to resolve class Version @ line 5, column 9. Version version = componentManager.getVersionManager().getVersion(project.getId(), "1.2") ^ Script1.groovy: 6: unable to resolve class ProjectComponent @ line 6, column 18. ProjectComponent component = componentManager.getProjectComponentManager().findByComponentName(project.getId(), "MyComponent") ^ Script1.groovy: 11: unable to resolve class ActionResult @ line 11, column 14. ActionResult aResult = CoreFactory.getActionDispatcher().execute(ActionNames.ISSUE_UPDATE, actionParams); ^ 7 errors

Are you trying to do this in confluence, or was that just a "tagging failure"?

Assuming you did mean jira, seems like you are missing an import: import com.atlassian.jira.ComponentManager

Thanks Jamie, and yeah I am doing 100 things on both JIRA and confluence. This is a JIRA thing, apologies. OK yeah that is why I really would like a how to like the develop your own plugins. Thanks I will try that (tomorrow as it is late in the East :)

OK That fixed the first line error, I probably just need more imports as I just copy pasted: https://jamieechlin.atlassian.net/wiki/display/GRV/Post+Functions#PostFunctions-SetAffectsVersions,FixVersionsorComponents which has no imports. It may help users if you post the imports in that block of code just like the other ones have. Just my two cents...

@Paul DeSousa Did you find that tutorial? I would be really useful this time for me, thanks!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

685 views 6 13
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