Queries regarding script runner

Swarna Radha May 24, 2015

Good day All,

My team has just downloaded script Runner for JIRA Add on. We have an issue regarding this.They try to run the following script found on the documentation (https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fields) :

import com.atlassian.jira.ComponentManager
def componentManager = ComponentManager.getInstance()
def leads= issue.componentObjects.toList()
if (leads) {
def lead=leads?.first()?.lead
if (leads){
componentManager.getUserUtil().getUser(lead)
}
}

;

We are getting the following  error: "Field not set up correctly - script is not defined" 

Can you guys please assist us.

Also, we have another query, we would like to know if we can set a field to mandatory via script runner, if yes, can you please guide us on how to proceed with this.

 

Thanks

Regards,

Swarna Radha

Team Lead Agile Team

Rubric Quality Consultants Ltd

5-25-2015 10-46-38 AM.jpg

6 answers

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 25, 2015

please create a different question with more context, explaining why you don't want to use a field config scheme to make it mandatory.

0 votes
Swarna Radha May 25, 2015

Hi Jamie, Thanks, it's working. Can you advise how to make a field mandatory using script runner

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2015

> can you click Update, then edit, then see if you get the same behaviour?

0 votes
Swarna Radha May 24, 2015

Hi Jamie, Even Thought I've changed to User template, The issue is still the same.

0 votes
Udo Brand
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2015

Why are you using a number field as template, you need a user template

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2015

I've changed your tags, not sure why you chose jira-agile? I don't know what is going on there... can you click Update, then edit, then see if you get the same behaviour?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events