I added a new text field in view screen, named "SLA Status". This filed type is "Text Field (single line)".
It be populated base on Time to resolution this field.
I added a post-function in CST this issue type's workflow, When I click resolve transition, It not works, appear error.
Please check the code:
string timeToValue = timeToResolution;
// Get index of last '|'
int index = lastIndexOf(timeToValue, "|");
int length = length(timeToValue);
if(substring(timeToValue, index+1, length) < 0)
{ slaStatus = "Breached"; }
else
{ slaStatus = "Met"; }
I will attached some screen shots.



