It's all about the answers!

Ask a question

id for "Filed Against" field in workitem


Zachary K (19354239) | asked Jul 07 '11, 10:24 a.m.
Hello,
I need to write a script that depends on the value of the "Filed Against" field in a workitem. What is the id for the field "Filed Against"?

Thanks in advance for your help.

5 answers



permanent link
Eduardo Bello (4401922) | answered Jul 07 '11, 10:34 a.m.
Hello,
I need to write a script that depends on the value of the "Filed Against" field in a workitem. What is the id for the field "Filed Against"?

Thanks in advance for your help.


File Against is also called Category. So you can use the attribute id: IWorkItem.CATEGORY_PROPERTY . Or simple get its values with IWorkItem.getCategory() method.



/**
* Returns the 'filed against' category.
*
* @return the 'filed against' category
* @see com.ibm.team.workitem.common.IWorkItemCommon#resolveHierarchicalName(ICategoryHandle, org.eclipse.core.runtime.IProgressMonitor)
*/
ICategoryHandle getCategory();

Comments
Fatos Sopjani commented Feb 06 '13, 10:06 a.m.

Hi, 


How do i get a selected item of Filed Against rather than the whole category, can i just get the value of filed against selected? 

Thanks,
fatos 


permanent link
Zachary K (19354239) | answered Jul 07 '11, 10:44 a.m.
Thanks for the quick reply. I'm writing a workitem Attribute Value Providers using Javascript not Java
I need to make my custom attribute depends on the selection of the "Filed Against" attribute. Something like this referencing the id of the Filed Against

 <attributeDefinition>

<dependsOn>
<valueSetProvider>
</attributeDefinition>


Is the id "category" ?

Thanks

permanent link
Michael Walker (99215201157) | answered Jul 12 '11, 2:06 p.m.
Thanks for the quick reply. I'm writing a workitem Attribute Value Providers using Javascript not Java
I need to make my custom attribute depends on the selection of the "Filed Against" attribute. Something like this referencing the id of the Filed Against

 <attributeDefinition>

<dependsOn>
<valueSetProvider>
</attributeDefinition>


Is the id "category" ?

Thanks



Add this to your javascript and then after it runs look at the Eclipse log for the id of the Filed Against value you selected in your work item.

var filed = workItem.getValue(WorkItemAttributes.FILED_AGAINST);
console.log(filed);

permanent link
Roger Layani (5313238) | answered Jul 13 '11, 8:31 a.m.
Hi

I am trying to implement same Javascript
but using :

var filed = workItem.getValue(WorkItemAttributes.FILED_AGAINST);
console.log("result:" + filed);

I got DBid of the selected category something like:
MESSAGE LOG: result: _gJW_cKrNEeCbw-akxBvZlA

I would like to return the string value of this category.
Do you know how ?

Thx for help

permanent link
Michael Walker (99215201157) | answered Jul 13 '11, 2:22 p.m.
Hi

I am trying to implement same Javascript
but using :

var filed = workItem.getValue(WorkItemAttributes.FILED_AGAINST);
console.log("result:" + filed);

I got DBid of the selected category something like:
MESSAGE LOG: result: _gJW_cKrNEeCbw-akxBvZlA

I would like to return the string value of this category.
Do you know how ?

Thx for help


I have not heard of a way. I ended up just using the id value in my logic, similar to using the id for the owner field.

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.