Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,659
Community Members
 
Community Events
185
Community Groups

Behaviours won't update custom field from plugin

Joe Mallon
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.
Aug 27, 2021

I have a custom field using this plugin:

https://marketplace.atlassian.com/apps/1211608/color-custom-fields

The structure of the field value is:

'customfield_15000' => {
'id' => '19106',
'self' => 'https://BLAH.com/rest/api/2/customFieldOption/19106',
'value' => 'Yellow'
},

When I try to update the field value using Behaviours, the field is set to null. Example:

def rp = getFieldByName("Risk Profile")
def rv = rp.getFormValue()
rp.setFormValue("Yellow");

I have also tried with:

rp.setFormValue("19106");

and

rp.setFormValue(19106);

In all cases, Risk Profile is set to null. In fact, just clicking the tab on which the Risk Profile form field sits sets it to blank, even without changing the field that should trigger the update of Risk Profile.

Is there a better way to set a form field or a value when the form field is non-standard?

Alternately, is there such a thing as an Edit post-function where I could set the value more programmatically?

2 answers

1 accepted

0 votes
Answer accepted
Joe Mallon
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.
Aug 30, 2021

Turns out I wasn't setting the field to the correct set of values. Once I figured that out, Behaviours worked as expected.

0 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 27, 2021

I would recommend you find a different way to achieve your requirement. That add-on's documentation and support pages don't appear to be available anymore (dead links).

This doesn't bode well for the likelihood of the developer creating new versions if/when a new version of Jira breaks the compatibility.

How to set values programmatically for that custom field would depend on the app having some API that are available to Scriptrunner and documented (hence why I was looking for documentation pages).

For the value to be "settable" in behaviour would depend on how the custom field is implemented and could require Adaptavist/Scriptrunner to be enhanced to support that custom field type. And that's not likely to happen on an app that appears dead and unsupported.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events