It's all about the answers!

Ask a question

Python Create Workitem in IBM RTC


Parthiban SG (154) | asked May 26 '20, 10:04 a.m.

 I am currently looking for a python script which can help in creating a workitem using the XML payload. I tried RTCClient but it is of not much help for future and hence I am looking for script via Requests library from Python


I tried cURL commands and I was able to create workitem in RTC but when I try to repeat the same via Python Requests, I don't get any luck in achieving it. Below is the snippet I am using to achieve the same. During my last GET, I get HTML error as "Javascript is either disabled or not available in your Browser". I believe my authentication is not working proper via Python whereas the same works fine with cURL

Can anyone help in correcting below syntax

RTCCookieURL = 'https://clmtest:9443/jazz/authenticated/identity'
RTCGetCookie = requests.get(RTCCookieURL, verify=False)
RTCCookies=RTCGetCookie.cookies
print(RTCCookies)
RTCAuthURL = 'https://clmtest:9443/jazz/authenticated/j_security_check'
RTCHeaders = {
'Accept': 'text/xml',
'Content-Type': 'application/x-oslc-cm-change-request+xml'
}
RTCAuth = requests.get(RTCAuthURL, auth=HTTPBasicAuth('uname','pwd'), verify=False, allow_redirects=True)
print(RTCAuth.cookies)
RTCGetCatalog = requests.get('https://clmtest:9443/jazz/oslc/workitems/catalog', verify=False, cookies=RTCAuth.cookies)
print(RTCGetCatalog.content)


Accepted answer


permanent link
Ralph Schoon (63.1k33645) | answered Nov 02 '23, 3:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 This blog series explains the various aspects: https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/ 

Ralph Schoon selected this answer as the correct answer

2 other answers



permanent link
Bharath Rao (900134) | answered May 29 '20, 1:32 a.m.

Hi Parthiban,


Have you tried the suggestions in the below link ?

Regards,
Bharath


Comments
1
Parthiban SG commented May 29 '20, 1:45 a.m. | edited May 29 '20, 1:46 a.m.

Hi Bharath,


It doesn't match my need since rtcclient get workitem works whereas create workitem is troublesome and taking long time

I figured out the OSLC was quite helpful and able to resolve the issue for workitem creation. It is quite fast and easy compared to rtcclient. We need to consider the spring security here for resolution. I was able to get that and now able to create workitems normally without rtcclient

Thanks
Parthiban


permanent link
Narendra Kumar Ramesh (11) | answered Nov 02 '23, 1:01 a.m.

 Hi Parthiban, can u please help me to create the new work item without using rtcclinet 

Your answer


Register or 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.