Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

work item attibute customization: make editable field after retrieving calculated value

 Hi,

I have a situation where I must pick up some attribute value and put it in WI summary.
I got it to work, but now I must make WI summary available for further editing (adding some additional text).

For example, I have custom attribute version with some value: 10.10.122
When I enter it, my WI summary must pick that value and leave it for further editing (example: v10.10.122_snap22).

As it is set that WI Summary use Calculated Value, every time when I want to change WI summary calculated value, on saving it returns origin calculated value.

I hope that my question is understandable. 

regards,

0 votes


Accepted answer

Permanent link
Milan,

the only thing that comes into mind is to try to return the current value of the attribute in the calculated attribute.
Calculated attributes always run based on their dependent attributes. There is no 'semi-calculated' value. Therefore there is no real solution for this case, I would be aware of. Usually you should use a default value for what you are trying, but there are only very few attributes available when the default value runs.

You can try if you can detect when the calculation should run or just return the current value. If you can't do that in JavaScript, you could try in Java. See: https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/
Milan Krivic selected this answer as the correct answer

1 vote

Comments

 Hi Ralph, 


just to inform you that I succeeded  to get what I want.
So the point was that in certain work item state I must pick up some other work item attribute value and leave it for further editing.
So, somewhere in the middle of my JavaScript code, I put this:

var other_value = workItem.getValue("com.apisit.release.app.version");
var type = workItem.getValue(WorkItemAttributes.TYPE);
var summary = workItem.getValue(WorkItemAttributes.SUMMARY);
var status = workItem.getValue(WorkItemAttributes.STATE);
if(type == "release_note" && status == "com.apisit.release.workflow.state.s3"){ //some work item type in some state
return other_value;
}
else
{
return summary;
}
Now, I am able in other WI state change this value (I mean add some text).

Thanks and Regards,
Milan

Which is kind of what I suggested. Please accept the answer.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020
× 57

Question asked: Sep 02 '13, 7:42 a.m.

Question was seen: 4,155 times

Last updated: Sep 04 '13, 3:06 a.m.

Confirmation Cancel Confirm