Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

make Time spent mandatory base on resolution value with script runner behaviours

Michael Shechter April 9, 2018

Hi,

I  want that Time spent will be mandatory  in the resolution value ="Tested"

but it doesn't work 

see my script:

 

--------------------------------------------------------------------

import com.atlassian.jira.issue.resolution.Resolution

def resolutionField = getFieldById("resolution")
def resolution = resolutionField.getValue() as Resolution
def timeSpent = getFieldByName("TimeSpent")
log.debug("resolution Value" + resolution)

if (resolution.name != "Tested"){
timeSpent.setRequired(false);
}else{
timeSpent.setRequired(true);

}

---------------------------------------------------------------------------- 

What I'm doing wrong? 

Thanks.

 

 

 

 

 

 

1 answer

0 votes
Alexey Matveev
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.
April 9, 2018

What is the TimeSpent field? If you mean that the timespent field, then you can not add it to screens. All you can add is :

etFieldById("timetracking_originalestimate")
getFieldById("timetracking_remainingestimate")

Suggest an answer

Log in or Sign up to answer