How to get the value of the SLA customfield?

kevin santos May 18, 2015

I'm trying to get the value of the SLA custom field but the value that is returned is an object. com.atlassian.servicedesk.internal.sla.model.SLAValue@********

5 answers

0 votes
IshanL
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.
May 26, 2016

This is the way,

CustomField cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_xxxx”);
String v = cf.getCustomFieldType().getStringFromSingularObject(cf.getValue(issue))
John Elnaugh September 1, 2016

How do you then decode this value, as i get it as a JSON value?

0 votes
IshanL
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.
May 16, 2016
0 votes
IshanL
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.
May 16, 2016

@kevin santos, Have you found a way to read it?

0 votes
Pedro Felgueiras
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.
March 24, 2016

I'm having the same problem. 

I have try to find it on any maven repositories but I didn't find the object. 

 

Do you have found solution ? 

 

IshanL
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.
May 16, 2016

@Pedro Felgueiras, Have you found a way to read the value?

 

0 votes
Timothy
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.
May 19, 2015

If you've gotten that far, have you tried to decompile the SLAValue? There's no API for it.

kevin santos May 19, 2015

i haven't tried that yet. how do you even do that?

Suggest an answer

Log in or Sign up to answer