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,974
Community Members
 
Community Events
185
Community Groups

cfValues in script runner

Hello All,

we have two workflows for two issue types. Task to is to created two sub tasks when a parent issue got created based on custom feild selection.
I have added the below code in the Script Runner :-
cfValues['11906']?.value == 'Bug' || cfValues['11906']?.value == 'Enhancement'

This code is working for first issue type and not working for the second issue type. Custom Field names are different for both the issue types.
I printed the logs, from the logs i understoond that "cfValues" has customfields related to first issue type only.

2019-02-08 03:34:55,704 WARN [utils.LazyCustomFieldsMap]: Did not find requested custom field 11906 on issue MTS-1564
2019-02-08 03:34:55,711 WARN [utils.LazyCustomFieldsMap]: Did not find requested custom field 11906 on issue MTS-1564

Can you please suggest that how to get proper cfValues when second issue type's workflow gets executed.

 

THanks in Advance,

Bunty

1 answer

Just stumbled upon this older question.

cfValues is a map-like structure where you can get the value of any custom field on the object. Note that the keys are the field name, and not id.

 You will have to access the field value by its name, the name like you will find it in the administation for custom fields in Jira.

cfValues['nameOfField'] == 'Bug' || cfValues['nameOfField'] == 'Enhancement'

try this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events