It's all about the answers!

Ask a question

how to change the description based on other attribute


Surender Biyyala (403848) | asked Aug 07 '14, 6:07 a.m.
edited Aug 08 '14, 7:37 a.m. by Ralph Schoon (63.6k33646)
 Hi All,

Can I set some default value to the description field if the work item is defect and the Classification attribute is risk.

here classification is a multi select (enumeration) and rist is the literal.

Thanks
Surender

3 answers



permanent link
Eric Jodet (6.3k5111120) | answered Aug 08 '14, 5:49 a.m.
JAZZ DEVELOPER
 Hello Surender,
you may want to try a calculated value set provider,
https://jazz.net/library/article/1003/#calc-values
use it to populate description based on classification attribute.

Please send me an email (eric_jodet@fr.ibm.com)
so I can share with you a working example.

Thanks,
Eric

permanent link
Ralph Schoon (63.6k33646) | answered Aug 08 '14, 7:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Aug 08 '14, 7:38 a.m.
Please be aware that the default value provider are only of limited use. They are only calculated at the creation of the work item where you don't yet have many user selected values e.g. a user selected risk value. There are only very few usable defaults at this point in time.

You can of course use a calculated value script, however that is always calculated, so you have to decide if you return a modified value, or not, which is really hard sometimes. Therefore the suggestion is to use calculated values only with read only attributes.

permanent link
Surender Biyyala (403848) | answered Aug 11 '14, 11:57 a.m.
 Thanks Ralph Schoon and EricJodet,
I have written a .js which does the work for me on saving the work item but there is one more problem here.

I have a script based condition already and now i have script based calculated value both these java scripts
is based on the same attribute.

dojo.provide("com.abc.tools.workitem.attribute.defectclassification"); 

in this case I`m getting a warning saying the class name is already used and the class name is not modifiable.

How can I get rid of this?

Note : Both the scripts are working fine if I activate only one of those.

Thanks
Surender.

Comments
Eric Jodet commented Aug 12 '14, 1:41 a.m.
JAZZ DEVELOPER

 Hello Surender,

if you get such warning, you possibly have another script that declares the same class.

Check Project Area attachments and remove unnecessary javascripts.

Eric


Ralph Schoon commented Aug 12 '14, 1:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Right, you can have multiple scripts running on the same attribute. You have to make sure that each script has a unique identifier in the declares section. If you copy scripts, at least change the class name.

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.