It's all about the answers!

Ask a question

How can if a work item is resolved or not using javascript


Georges Oneissy (53522) | asked Jan 30 '17, 8:31 a.m.

I am creating a calculated value that sets a delivery status to "Late" for some condition ONLY IF the state is not resolved.


How can I check if the work item is resolved or not using javascript? Please help

if (dueDate < today && <resolution != true> )
DeliveryStatus = "Late";


Comments
Georges Oneissy commented Jan 30 '17, 8:39 a.m.

 Something like 


<attribute name="internalState"/>
<variable arguments="open or in progress" type="state"/>

One answer



permanent link
Ralph Schoon (63.3k33646) | answered Jan 30 '17, 8:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jan 30 '17, 8:53 a.m.
To get the current ID of the state attribute.

  var currentstateID = workitem.getValue("internalState");


To get the current dsplaylabel of the state attribute.

  var currentstateLabel = workitem.getLabel("internalState");

Based on that information you have to decide if the work item is resolved or not.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.