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

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,338 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot