It's all about the answers!

Ask a question

RTC Work Ticket Failing Creation - 'Owned By' Attribute Needs to be Set


Sean Lauren (733) | asked May 12, 9:42 a.m.
edited May 13, 8:54 a.m.

 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:

         xmlns:dcterms="http://purl.org/dc/terms/" 
         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
    <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 &lt;08:54:54&gt;).</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


permanent link
Sean Lauren (733) | answered May 13, 8:55 a.m.

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, 9:52 a.m. | edited May 13, 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, 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



permanent link
Ralph Schoon (57.1k23642) | answered May 12, 12:22 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited May 12, 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.

  1. Understand the operational behavior that is configured for the target project area to understand what is needed for this to work.
  2. Once you understand that, create item(s) you want to create via automation manually.
  3. Investigate what the values are. E.g. do a GET on such an item.This should give you all the information you need for your question above.
  4. Figure out what is what and automate it.

I am pretty baffled when I read questions where automation developers seem to unaware of what the configurated process is and ask what to do. As an automation developer, you have to investigate and understand your environmnet, the configured process and the related details, collect the information required and then do the automation (where possible). Usually doing things manually and then trying to understand the information produced is the best way to achieve your automation.

Comments
Sean Lauren commented May 13, 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! :-).


Ralph Schoon commented May 13, 9:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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


Register or to post your answer.