It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 Aug 07, 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

@Tansu Akdeniz ThankQ Boss. 

It's Worked. 

Cheers.

Tansu Akdeniz Community Leader Aug 07, 2019

You are welcome @Bollareddy !!

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

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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you