Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Prefill "Team" Field in Jira using Scriptrunner Behaviours

Saravanakumar C January 9, 2024

Hi All,

I am trying to prefill the Team field using Scriptrunner Behaviours in create screen. But it is not working.

Is there anyone who faced this issue and resolved before?

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
January 9, 2024

Hi @Saravanakumar C

Can you please clarify what type of field is the Team Field?

If you intend to prefill the value to the field, you will need to use the Behaviour Initialiser.

Below is a sample Behaviour Initialiser code for your reference:-

def field = getFieldByName('Field 1')
field.setFormValue('Testing 123')

Please note that the working sample code above is not 100% exact to your environment.

Also, if you intend for this Behaviour to take effect only on the Create screen and not other screens, you will need to add an additional condition to it as shown below:-

if (!underlyingIssue) {
def field = getFieldByName('Field 1')
field.setFormValue('Testing 123')
}

Hence, you will need to make the required modifications.

I am looking forward to your feedback and clarification.

Thank you and Kind regards,
Ram

Saravanakumar C January 9, 2024

Hi @Ram Kumar Aravindakshan _Adaptavist_ ,

Thanks for the feedback. Please find the below screenshot

Capture.PNG

This Team field comes from Advanced Roadmaps. 

I tried to use your recommendation, but unfortunately it is not working.

Suggest an answer

Log in or Sign up to answer