How to access the Deliverable type attribute through script?
We have the target release filed defined as a Deliverable type attribute in the work item. I would need to access the value selected for this enumeration field and do certain validations on the other fields in the work item.
I am having trouble in accessing the value selected for this Deliverable type attribute. Appreciate any inputs.
Thanks!
2 answers
According to this wiki article: https://jazz.net/wiki/bin/view/Main/AttributeCustomization a very limited set of attribute types are available for reading and writing from scripts (and Deliverable isn't on that list). There is some special discussion of working the enumerations that may help. But it's possible this value is not available via scripting.
Comments
Thanks for the response Millard.
My requirement would be to update certain flags in the work item, based on the value selected for this Deliverable type enumeration. Would you suggest going for a Java implementation instead of the scripting option?
Thanks again.
Are the target values read-only or are you coercing the values?
What you are essentially discussing is a calculated value customization. See same article linked above. The thing is that calculated values should only be used for read-only attributes, so if those flags you want to change are editable by the user, your results from scripting could be disappointing.
As to approach, I favor the lightest-weight solution that will work. If you can get the results you want via scripting, I'd go that route. If you don't think that will work, I'd consider ways that I could change the requirements to fit a scriptable solution. Failing that, I'd contribute and Advisor built on the Java API.