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

Set the "Original Estimate" field based on the value of a custom field.

I'm trying to set the "Original Estimate" field based on the value of a custom field (Select List (single choice)).
I don't know why it won't set the value. Setting another field "Description" works just fine.
I assume that I'm holding the proper objects as the logging is correct.

 

def qualification = getFieldByName("Qualification").getValue();
def originalEstimate = getFieldById("timetracking");
def descr = getFieldById("description");

log.info("qualification: '" + qualification + "'");
log.info("originalEstimate: '" + originalEstimate.getValue() + "'");

if (qualification == "Very Small") {
	descr.setFormValue("15m");
	originalEstimate.setFormValue("15m");
} else if (qualification == "Small") {
	descr.setFormValue("30m");
	originalEstimate.setFormValue("30m");
} else if (qualification == "Medium") {
	descr.setFormValue("1h");
	originalEstimate.setFormValue("1h");
} else if (qualification == "Large") {
	descr.setFormValue("2h");
	originalEstimate.setFormValue("2h");
} else if (qualification == "Very Large") {
	descr.setFormValue("4h");
	originalEstimate.setFormValue("4h");
}

2 answers

Hy Jamie,

Thx for your response!

I tried using 'getFieldById("timetracking_originalestimate")', but it doesn't seem to work at all.

When debugging my Jira, I noticed that the time tracking form field has 'timetracking' as id. I don't know if it's a small bug in Jira or if I just have a bad version.

log.png

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.
Apr 21, 2017

IIRC the time tracking field is actually two fields on screen, so you need:

getFieldById("timetracking_originalestimate")

It's a "special case".

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events