RTC 6.0.6.1 Failing to set Priority & Severity...other enums OK
I am writing a tool that creates new work items with quite a few attributes. The POST is working fine and the work item is being created with no errors and all attributes are being set, except for priority and severity.
Accepted answer
Dave,
{ "dcterms:title": "Work Item Created from JSON in Python.", "dcterms:description": "This is a work item linking to Jazz.net">https://jazz.net/\"">Jazz.net.", "rtc_cm:filedAgainst": "https://elm.example.com:9443/ccm/resource/itemOid/com.ibm.team.workitem.Category/_HWNLMFpnEeukW7cqqDjAuA", "oslc_cmx:priority": "https://elm.example.com:9443/ccm/oslc/enumerations/_8e5qfFpmEeukW7cqqDjAuA/priority/priority.literal.l11" }
Comments
PS: at the moment I have no idea how to get the "oslc_cmx:priority" from the property definition: "oslc:propertyDefinition": {
If an RDF framework such as Python RDFLib is available, it is possible to create a mapping for the namespace prefix and the namespace.
oslc_cmx = 'oslc_cmx' oslc_cmx_URI = 'http://open-services.net/ns/cm-x#' oslc_cmx_ns = Namespace(oslc_cmx_URI)g = Graph() g.bind("rdf", RDF) g.bind("rdfs", RDFS) g.bind("dcterms", DCTERMS) g.bind(self.oslc_cmx, self.oslc_cmx_ns)
.......definition = URIRef('http://open-services.net/ns/cm-x#priority') result = definition.n3(g.namespace_manager)
This allows to resolve the information 'oslc_cmx:priority'.
If there is no such framework it would be necessary to create a custom mapping e.g. from 'http://open-services.net/ns/cm-x#' to 'oslc_cmx'
Oh, interesting. For some reason I thought the rdf:resource property was required in the json. I left it out following your example and it WORKS! THANKS RALPH!
I tried to share some of my experience in this blog series: https://rsjazz.wordpress.com/2021/09/29/using-the-ewm-rest-and-oslc-apis/