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

Query RTC api server - Argument must be an instance of IAuditableHandle

 RTC 6.0.5, java version 1.7, api server,

java plugin in a Custom Advisor (but it will also be used for an Operation participant).

Hi, I tried to follow the methods to query RTC with the bees server, I think I have seen them all and I have also thrown something down, but unfortunately I always get this error:

Exception checking precondition. An unhandled exception occurred during "Prohibit Save (ASISE)".
Argument must be an instance of IAuditableHandle.
Now do not pay attention to the details but it is a CustomAdvisor that gives the problem as if I had not instantiated something correctly but what ?? Thanks.
I also attach the code, but it is exactly what I found both here and on other posts, I just changed the value of an attribute ...
[Code]
IAuditableCommon audCommon = workItemServer.getAuditableCommon ();
IQueryableAttributeFactory queryAttrFactory = QueryableAttributes.getFactory (IWorkItem.ITEM_TYPE);
// IQueryableAttribute projectareaAttribute = QueryableAttributes.getFactory (IWorkItem.ITEM_TYPE) .findAttribute (projectArea, IWorkItem.PROJECT_AREA_PROPERTY, audCommon, monitor);
IQueryableAttribute projectAreaAttribute = queryAttrFactory.findAttribute (projectArea, IWorkItem.PROJECT_AREA_PROPERTY, audCommon, monitor);
AttributeExpression projectAreaExpression = new AttributeExpression (projectAreaAttribute, AttributeOperation.EQUALS, projectArea);
// TipoWi
// IQueryableAttribute typeAttribute = QueryableAttributes.getFactory (IWorkItem.ITEM_TYPE) .findAttribute (projectArea, IWorkItem.TYPE_PROPERTY, audCommon, monitor);
IQueryableAttribute typeAttribute = queryAttrFactory.findAttribute (projectArea, IWorkItem.TYPE_PROPERTY, audCommon, monitor);
AttributeExpression typeExpression = new AttributeExpression (typeAttribute, AttributeOperation.EQUALS, "com.ibm.team.apt.workItemType.story");

IQueryableAttribute referencingWIAttribute = queryAttrFactory.findAttribute (projectArea, IWorkItem.TARGET_PROPERTY, audCommon, monitor);
AttributeExpression referencingWIExpression = new AttributeExpression (referencingWIAttribute, AttributeOperation.EQUALS, valueAttribute);

Term term = new Term (Term.Operator.AND);
term.add (projectAreaExpression);
term.add (typeExpression);
term.add (referencingWIExpression);

System.out.println ( "****");
System.out.println ("Attribute:" + typeExpression.toString ());
System.out.println ("Wi:" + referencingWIExpression.toString ());
System.out.println ("term:" + term.toString ());
IQueryResult <IResolvedResult <IWorkItem>> queryResult = queryCommon.getResolvedExpressionResults (projectArea, term, IWorkItem.FULL_PROFILE);
int resultSize = queryResult.getResultSize (monitor) .getTotal ();
[/ Code]

0 votes



One answer

Permanent link

 Hi, I answer immediately because I have not found the solution but I have found the answer.

The problem is the plannedFor attribute, obviously I use it badly and therefore gave that error. Putting a custom attribute created by me (which is nothing more than a string populated by a js with the same value as PlannedFor) works, thanks.

0 votes

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,927
× 411

Question asked: May 07 '20, 7:28 a.m.

Question was seen: 2,054 times

Last updated: May 07 '20, 8:11 a.m.

Confirmation Cancel Confirm