It's all about the answers!

Ask a question

Set value of multiple fields in a workitem


Mathieu Defianas (15942438) | asked Jun 19 '12, 9:44 a.m.
Hello,
I would to customise workitem and so I use dojo script in "Calculated values" to change value of my fields.
I have succeeded to modify a value of ONE field when I change the state of my workitem with the dojo method "return".
In fact, as this script is linked to only one field, only one field can be modified ...
I would like in the same script modify some fields ... In the documentation, I see that the method getValue can be used but is the method setValue() exist ???
Have you got a documentation of this specific dojo api ?
Thanks a lot
Mathieu

9 answers



permanent link
Gabriel Enriquez (3463) | answered Jun 19 '12, 5:04 p.m.
JAZZ DEVELOPER
It is not possible to set a value through this "Calculated Value" script mechanism. See this article for the API reference.

As an alternative, you can use another calculated value script on the other attribute.

--
Gabriel Enriquez, IBM Rational, Tracking & Planning

permanent link
Muthukumar C (32712833) | answered Jun 20 '12, 8:32 a.m.
1. Based on where you are Creating the Plug-in Site folder, It will be decided.
       - Correction, What we are talking about is Plain Java API. Not java script.
2. They will be stored in the RTC Server. Not any where in the Project area.
3. It Should.

Before that make sure who have gone through the Links

https://jazz.net/library/article/784

and especially

https://jazz.net/library/article/634

Comments
Mathieu Defianas commented Jun 20 '12, 3:53 p.m.

Muthukumar, I have read this article https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Conditions . You see in the part "Providing new customizations implemented in Java", that Java API seems not to work on the Web UI. It's very strange with your solution ... Have you tested your plugin in the web site ? Thanks Mathieu


permanent link
VK L (8177145159) | answered Jun 20 '12, 11:59 p.m.
Hi Mathieu,

1. A plugin is not a script, but a complete package deployed at server or client level.
2. For a server-side plugin - contents will be extracted into corresponding sites folder and path mapped in provision profiles directory.
3. Server-side plugins - will be triggered on certain operations - like save workitem and will execute on any client. (Process config->Team configuration->operation behaviour)

Comments
Mathieu Defianas commented Jun 21 '12, 2:39 a.m.

Thanks Valli !!! This week-end I hope I will have time to develop my first plugin and test to execute code when I save a workitem


permanent link
Mathieu Defianas (15942438) | answered Jun 20 '12, 2:53 a.m.
Thanks Gabriel for your post.
It's also my workaround but there is a big problem ...
What is the first field which will be updated ??? In fact, I cannot organize the order of my scripts when they are executed ...
Have you got an idea to modify this order ?
Thanks !
Mathieu

Comments
1
Gabriel Enriquez commented Jun 20 '12, 12:06 p.m.
JAZZ DEVELOPER

The execution follows the order on which those were defined in the Work Item Type attributes (Process Configuration). Unfortunately, there is not an explicit attribute to declare such execution order.

You can also help us filing an enhancement for such behavior at RTC jazz.net.


Mathieu Defianas commented Jun 20 '12, 1:51 p.m.

Ok gabriel ! It's a very nice idea !!! So I am going to modify the process configuration in order to call first the fields which interest me !!! When I will have a feedback I post a comment here. Mathieu


Mathieu Defianas commented Jun 20 '12, 3:51 p.m.

Gabriel, I have just tested your proposal and it doesn't work ... In fact, I have 2 fiels that I have renamed in the Process Configuration to be executed in good order but finally this order isn't respected ;-( I have tried to examine the xml code but the order is the same than the Process configuration. Thanks Mathieu


permanent link
Muthukumar C (32712833) | answered Jun 20 '12, 6:12 a.m.
Hi,

I am advising you Server side Operation Participant (Java API) to modify the values of attributes as in the order you want during the Save operation.

Muthukumar.C

permanent link
Mathieu Defianas (15942438) | answered Jun 20 '12, 8:00 a.m.
Thanks Muthukumar but I have read on the documentation that if I use Java API, the scripts could not be executed on the web access and the scripts should be installed on each eclipse client ...
So this solution seems to be very binding ;-(
Mathieu

permanent link
Muthukumar C (32712833) | answered Jun 20 '12, 8:04 a.m.
Hi,

There are two types of Plug-ins available. One is Client Side what you are talking about and another is Server side which will execute in the Server before saving every work item. [No need for Client level installation]

So, You can go with Server side plug-in.


permanent link
Mathieu Defianas (15942438) | answered Jun 20 '12, 8:19 a.m.
Thanks a lot !!! It's a very important information :-)
So I have questions :
1) How do you know if the script is a "Server side plug-in" and not a "Client Side plug-in" ?
2) Where are they stored ? In the "Calculated values" ?
3) Are you sure that the "Server side plug-in" can be executed fro mthe web site ?

permanent link
Mathieu Defianas (15942438) | answered Jun 21 '12, 2:38 a.m.
Thanks Valli !!!
This week-end I hope I will have time to develop my first plugin and test to execute code when I save a workitem

Your answer


Register or to post your answer.