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

Product code and work item displayed as a single field

I am looking to create a field that can be included in a query that simply combines the work item and a product code as something like ABC-4789.  Is it possible to write your own custom attribute?  Alternatively it looks like I could add a string field attribute and write an Operation Participant triggered on work item save to update a field with this information.  And a third idea would be to write a javascript field validator, but that I think that may not run in all cases where a work item is created.

Any thoughts appreciated!

0 votes


Accepted answer

Permanent link
 Hello Vince,
what is the work item attribute to you want to pick ? work item number, summary, another attribute?
I understand that you want to create a custom attribute which value will be calculated,
and equal to <some_attribute> + <product_code>

If this is correct, I would use a JS provider and calculated values:

Hope it helps,
Eric.

Vince Thyng selected this answer as the correct answer

0 votes

Comments

Eric,
I want to use ID and either an abbreviated version of Filed Against (Category), or a value from an enumeration, or perhaps codes that I would have stored in the JS provider.

Are you aware of any work item manipulations that would not trigger the javascript to run?  If not, that seems like a good way to solve this.  I would populate a custom field with a combination of work item ID and code based on the Filed Against field.  Users would then include this custom field in their query as their preferred method of seeing ticket numbers.
For example do work item imports, command line work item creates/updates, and source code changeset delivers all run associated JS providers?

 Vince,

you may calculate / set the attribute's value based on a given state

Eric


One other answer

Permanent link
JavaScript would not work as far as I can tell. See the limitations described in https://jazz.net/library/article/1093 Lab 5. It might be possible to use a calculated value using Java see http://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ but it would have to grab the data from a string field and a work item type attribute.

0 votes

Comments

 Hello Ralph,

what are the limitations you're referring to?
?
Thanks

Hi Eric,

I tried to summarize what https://jazz.net/library/article/1003/#customattributes says and what I experienced while creating the Process Enactment Workshop Lab 5 and other assets in https://jazz.net/library/article/1093  Lab5 (the first sections).

Basically there are a lot of limitations if you want to work on item type attributes in JavaScript. You can get the value and the name and it will provide with a uuid and maybe some displayable data (maybe the summary and the work item IF for a work item type attribute, so maybe you get what you want.) I am not really sure, what you'd get for a work item attribute. You can not follow links etc. JavaScript is just very limited. You can try to use it, but it might not provide what is needed. Java providers are a lot more flexible and can access a lot more data than in JavaScript.


Thank you Ralph and Eric!

It looks like I am able to deliver the kind of field my users are looking for with javascript.  Thank you both!

 Glad we could help, Vince.

(Thanks Ralph)

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
× 10,938
× 15

Question asked: Sep 19 '13, 7:09 p.m.

Question was seen: 6,082 times

Last updated: Sep 24 '13, 12:45 a.m.

Confirmation Cancel Confirm