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

Method getValue() does not work on initialiser function

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 07, 2017

Hi,

It seems that in the initialiser function behaviours cannot evaluate any field on view screen.

i.e. something like 

def field = getFieldById("customfield_12345")

returns null. Which prevents us doing any conditional formmating... bummer.

Best regards,

Antoine

2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Joshua Yamdogo @ Adaptavist
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.
Dec 07, 2017

There are two problems here.

  1. Form values aren't available in initializers. You may need to use the underlyingIssue object. See open bug https://productsupport.adaptavist.com/browse/SRJIRA-2027
  2. Behaviours function on the Create Issue, Update/Edit Issue, Assign Issue, and Workflow Transition screens. They don't work on the View Issue screen. See https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html#_screens
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 07, 2017

Hi Joshua,

One more issue about the initializer. If I edit the issue, and validate the update, the initializer runs multiple times, I do not know why. As a result, the popup appears several times, and makes the feature unusable.

Regards,

Antoine

0 votes
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 07, 2017

Ah, I forgot about underlyingIssue. It actually solved my problem since I need to evaluate a custom field and add a pop-up accordingly. 

This piece of information is nice to have in mind though.

Thanks.

TAGS
AUG Leaders

Atlassian Community Events