I'm new to Script Runner..Please help me out.

Bollareddy August 6, 2019

Hi., I have a coding knowledge and able to write a code. </Br>Problem,  is i don't know where to place written code by using script runner plugin, (Write in Console). run the code in Script runner console. No Errors.  For Ex Requirement: Custom Field: Do have an on this product? If Yes...Assign to User1. If No---Assign to User2. This is my Requirement. But i don't know where to keep the code in JIRA. Please Navigate me step by step. Thanks for your patience.

1 answer

1 accepted

0 votes
Answer accepted
Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 7, 2019

Hi @Bollareddy ,

Welcome to community.

I highly recommend you check this link.

1) You can test your groovy code from Script Console. When everything is fine,

  • Go to the workflow, than select the transition (ex; Create)
  • Add post-postfunction -> Script post-function -> Custom script post-function
  • Than paste your code as an inline script here.

Btw, it is better to create a .groovy file, than locate under ../JIRA_HOME/scripts directory and select it.

Conditions and validators also work in a same way.

For Ex Requirement: Custom Field: Do have an on this product? If Yes...Assign to User1. If No---Assign to User2.

You can definetely do that via groovy.

ps: Don't forget to remove static issue key from your test code. System automatically recognizes "issue" object.

//Issue issue = ComponentAccessor.getIssueManager().getIssueObject("ABC-297")

Regards

Bollareddy August 7, 2019

@Tansu Akdeniz ThankQ Boss. 

It's Worked. 

Cheers.

Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 7, 2019

You are welcome @Bollareddy !!

Maria Calamanan January 19, 2020

i am completely new to coding and all my information was taken from me. I need help. 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2020

You might want to raise this as a new question, one that has detail on what you're actually looking for.  (The only people you've really reached here are the two posters and any watchers)

Suggest an answer

Log in or Sign up to answer