RTC Work Ticket Failing Creation - 'Owned By' Attribute Needs to be Set
I'm trying to generate a Build Ticket in RTC via a post to our Jazz server. When I do, I'm always met with the error that I need to set the 'Owned By' attribute. As far as I can tell from documentation, dcterms:contributor is the owner. I've tried making up a "dcterms:ownedBy" and "dcterms:OwnedBy" and "dc:OwnedBy" etc, but nothing works. Why doesn't it like it??
What I'm Sending:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:rtc_ext="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/">
<rdf:Description rdf:nodeID="A0">
<dcterms:contributor rdf:resource="https://[host]/jts/users/[user_id]" />
<rtc_cm:due rdf:dataType="http://www.w3.org/2001/XMLSchema#dateTime">2020-06-24T16:00:00.000Z</rtc_cm:due>
...
Response:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#">
<oslc:Error rdf:about="#n0">
<oslc:message>'Save Work Item' failed. Preconditions have not been met: The 'Owned By' attribute needs to be set (work item <08:54:54>).</oslc:message>
<oslc:statusCode>403</oslc:statusCode>
</oslc:Error>
<rdf:Description rdf:about="https://[host]/ccm/oslc/contexts/[project-key]/workitems/[build.item]">
</rdf:Description>
</rdf:RDF> |
Accepted answer
Turns out, the error was lying. If any of the attributes are incorrectly set up, I will get the preconditions error for "Owned By" not being set. In the end, I had a couple attributes wrong. In the example above, the rtc_cm:due was wrong for having rdf:dataType in the tag (which I simply copied the format from the "get"). Removing it made it work fine. Ralph Schoon selected this answer as the correct answer
Comments
Ralph Schoon
commented May 13 '20, 9:52 a.m.
| edited May 13 '20, 9:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Great you got it working.
These APIS aint easy and Error messages can be deceiving...
I found that using Eclipse Lyo removes some of the hardships generating the Requests and parsing the responses. Of course it adds other complexities.....
I would assume if you did a get on an existing item with the values set, you would have been able to find the issue, right?
Sean Lauren
commented May 13 '20, 10:08 a.m.
I think the Get is actually what made me do it the wrong way :-P. I was trying to include dataType because the Get return shows dataType as a field. Not sure why I can't or shouldn't mimic that. |
One other answer
Ralph Schoon (63.5k●3●36●46)
| answered May 12 '20, 12:22 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited May 12 '20, 12:29 p.m.
Tools have rules and in EWM/RTC, they can also be configured. The error message suggests that preconditions such ar "required attributes for type and state" are active. Here my suggestions.
Comments
Sean Lauren
commented May 13 '20, 8:53 a.m.
Communication is complicated in large corporations--especially when working on side projects outside your main role. I don't even know the people who configured nor where to get such information so it's a lot of trial and error. This particular question, I was doing exactly what it told me was wrong so I wasn't sure why it told me it was wrong. I did everything right, and it turns out it was straight-up lying. It had an issue with my other fields and lied about which was the problem. Perhaps that's a config issue for the server itself, but I wouldn't know! :-).
This is a common issue.
I usually use a very simple local test system, where I have all the control for developing my stuff. Once it works good enough, I test against other target systems.
Setting up such a test system is very easy. For RTC only you can download the small zip version of JTS and CCM then run a quick setup using derby.
As an example of step by step, the RTC Extensions Workshop covers this.
|
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.