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

error when creating work item with too long description

Hi,

I'm trying to create a work item with a long description, using
    IWorkItemHandle handle = service.getWorkItemWorkingCopyManager().connectNew(workItemType, monitor);

WorkItemWorkingCopy wc = service.getWorkItemWorkingCopyManager().getWorkingCopy(handle);
IWorkItem jazzWI = wc.getWorkItem();
...
jazzWI.setHTMLDescription(XMLString.createFromPlainText(message));

where message can be really long, so I got this exception:
com.ibm.team.repository.common.validation.PropertyConstraintException: Validation errors for item: type = WorkItem, itemId = [UUID _cSjhYKubEeCEcsklv5qnDA]

Value of attribute "description" is 34245 bytes, which is greater than the allowed encoded length of 32768 bytes.


My questions:
    1. How can I find out maximum length of a certain attribute (for example Description has max encoded length of 32768)?
    2. How can I calculate this encoded length? In this case message.length() is 27635, and XMLString.createFromPlainText(message).getXMLText().length is 32704.


Obviously I'd like to dynamically truncate 'message' to fit into work item's description attribute, so if there's any easier way to do this, that would also be appreciated.

Thanks,
Attila

0 votes



One answer

Permanent link
Anyone any idea?

Thanks,
Attila

0 votes

Comments

Any one having any idea of the above issues.I am too facing the similar issue.Any ideas/updates will be quite helpful

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,937

Question asked: Jul 11 '11, 5:11 a.m.

Question was seen: 6,147 times

Last updated: Jun 11 '12, 4:10 a.m.

Confirmation Cancel Confirm