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

how to set the value of the Constraint Type of a workitem creating programatically using Plain Java API RTC

Hi Everyone,

We have a requirement to create a work item using plain java api programmatically. I tried to set the values of the attribute Constraint Type as similar way of setting the values of Priority and severity.But it didnt work for me.
please help me .


IWorkItemClient workItemCommon = (IWorkItemClient)rtcRepository.getClientLibrary(IWorkItemClient.class);
       
        IEnumeration enumeration= workItemCommon.resolveEnumeration(attribute, nullProgressMonitor);
        List<ILiteral> enumList =    enumeration.getEnumerationLiterals();
        for(ILiteral lit: enumList) {
            System.out.println("litername>>>"+lit.getName());
            if(lit.getName().equalsIgnoreCase(literalName)) {
        
            return lit.getIdentifier2();

finally i set the returned identifier to the workitem Constraint Type Attribute

Thanks in advance!!!

0 votes


Accepted answer

Permanent link

The Constraint Type is an enumeration and can be set as such. I tried with the Work Item command Line ad it works just fine. Note that for any value other than asap, you have to also set the timestamp for the constraint date.

lakshmi jyothsna selected this answer as the correct answer

0 votes

Comments

Thanks alot Raplph. 

 Hi Ralph,


We didnt know this :
Note that for any value other than asap, you have to also set the timestamp for the constraint date. 

its very useful to me

Why would you not know this? Certainly you would have looked into how the UI works with the data, before you looked at the API, wouldn't you?

Try to set a no later than and not provide a data and save. Error. I would imagine that the error in the API during save would also hint the missing date. Yes, the errors can sometimes be a bit mysterious, but all in all they usually make sense and hint what the issue is.

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

Question asked: Apr 01 '20, 6:29 a.m.

Question was seen: 640 times

Last updated: Apr 02 '20, 2:21 a.m.

Confirmation Cancel Confirm