It's all about the answers!

Ask a question

How to set Boolean attribute value using calculated value script


Balamurugan Selvarasu (331430) | asked Mar 08 '16, 5:24 a.m.
edited Mar 08 '16, 5:39 a.m.
 Hi All,

I want set boolean attribute value based on the status. How to return boolean value in caluclated value script.

Appreciate your quick help.

Accepted answer


permanent link
Gabriel Enriquez (3463) | answered Mar 08 '16, 1:17 p.m.
JAZZ DEVELOPER
Just return a boolean variable or the result of a evaluation.

For instance,

var state= workItem.getValue(WorkItemAttributes.STATE);
return (state === "3" || state === "4");
	


Ralph Schoon selected this answer as the correct answer

Comments
Sunny Kumar commented Jan 08 '23, 2:43 a.m.

Hi @Gabriel,


I have the same requirement as Balamurugan mentioned, but i think it wont set the attribute value though it returns the state. Please correct me if i am wrong.


Ralph Schoon commented Jan 09 '23, 2:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You are wrong. The comparison returns a boolean, the or operation on two booleans returns a boolean. You could also return true or false. See https://www.w3schools.com/js/js_booleans.asp

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.