How to retrieve work Item state using (workItem.getValue( WorkItemAttributes.STATE )) ?
I am trying the work item customization in RTC and I want to Retrieve current State of workitem using (workItem.getvalue(WorkItemAttributes.STATE)) and set to other presentation called "Current State Of Task".
current State of Task : In process
Accepted answer
The problem is in your "switch" statement. It should be:
2 other answers
you may want to print out to the console, after you get the state value.. then reuse the returned value for your cases.
there is a special note on value returned by getValue for states mentioned in here :
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_an_item_s_Status_attri
If the state id is of the form
s###
where ### is an integer value,
getValue()
will return a string representation of the integer value. For example by default the Verified state has the id
s4
. Therefore when using
getValue()
the result will be the string
"4"
.
hence the console.log of the obtained value can ensure you have the right case statements.