Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

Cannot update time spent field via ScriptRunner Behavior on form

To get the time spent and remaining estimate field ids and and current values:

def timeSpentField = getFieldById("timespent") // or  getFieldById(TIME_SPENT)
def mIssue = underlyingIssue as MutableIssue
def timeSpent = mIssue.getTimeSpent()

def remainingEstimateField = getFieldById("timeestimate") // or getFieldById(TIME_ESTIMATE)
def remainingEstimate = mIssue.getEstimate()

To update the time spent field on the form:

 timeSpentField.setFormValue(remainingEstimate)

The new value for time spent does not appear on the screen on which I have placed the work log field.

I am able to update another field, which I tried as a test:

getFieldById(DESCRIPTION).setFormValue("Would like to set the time spent field to ${timeSpent}.")

I suspect that I am not getting the field object for the "timespent" field since I am unable to update it on the screen via setFormValue.

I would appreciate some help getting this to work.

Thanks!

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Katy Kelly
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.
Jun 30, 2017

For other users experiencing this please add yourself as a watcher to the bug report here

Katy

Adaptavist Product Support 

0 votes
Aidan Derossett [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.
Jun 27, 2017

Hey Patricia,

What screen are you expecting this to work on, the issue View screen or some other screen, like the Create or Update screen? If you expect to see changes on the View screen via behaviors, you may unfortunately have to change your approach. Behaviors are only really set to function on the Create, Update, and Transition screens (as well as a couple of others), but not on the View screen. 

If you could get back to me with a little bit more information about what you are expecting this to do and which contexts you are expecting it to work within, I could give you a better and more specific answer. It'd also be good to know if you are trying to use this script in an initializer or as a field behavior.

Get back to me if you can!

Aidan

Hi Aidan,

Thanks for replying to my posting. After some searching I discovered that Adaptavist has a support portal for customers. I went ahead and submitted a request to the portal and received a prompt reply. It turns out that this is a known problem that has not been addressed yet.

https://productsupport.adaptavist.com/browse/SRJIRA-2204

Regards, Patricia

TAGS
AUG Leaders

Atlassian Community Events