How to change the status of WorkItem in RTC

匿名 (未验证) 提交于 2019-12-03 10:10:24

问题:

I need to chage the status of a workitem(Task) in RTC throgh VBScript. I've tried like this:

rtc_cm:status,https:/local/ccm/resource/itemName/com.ibm.team.workitem.defectWorkflow.action.startWorking 

This is not working. Someone please help?

回答1:

Since there is no command line for Work Items, you need to use the REST API:

URL="https://localhost:9443/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/821" curl -D - -k  -b $COOKIES -o "wi-821.json" -H "Accept: application/x-oslc-cm-changerequest+json" $URL 

=> Modify what you need in that wi-821.json file, like the rtc_cm:state, and post it back

URL="https://localhost:9443/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/821" curl -D - -k -b $COOKIES -H "If-Match: _1am9cFm0Ed6ELJg2MQ68Kg" -H "Content-Type: application/x-oslc-cm-change-request+json" -H "Accept: application/x-oslc-cm-change-request+json" -X PUT --data-binary @wi-821.json $URL 

This isn't in VB, but you can adapt it in order to encapsulate it in VB.



回答2:

According to https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Attributes the RTC status is "modifiable via action". You need to use a URL like:

set WORK_ITEM_ID=123456 set URL="https://localhost:9443/ccm/oslc/workitems/%WORK_ITEM_ID%?_action=com.ibm.team.workitem.activityWorkflow.action.startWorking" curl -D - -k -b %COOKIES% -H "Content-Type: application/x-oslc-cm-change-request+xml" -H "Accept: application/x-oslc-cm-change-request+xml" -X PUT --data-binary @input.xml %URL% 

Where input.xml contains the following:

<?xml version="1.0" encoding="UTF-8"?> <oslc_cm:ChangeRequest xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/"      xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"      xmlns:dc="http://purl.org/dc/terms/"     xmlns:oslc_pl="http://open-services.net/ns/pl#"      xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"     xmlns:oslc_cmx="http://open-services.net/ns/cm-x#">  </oslc_cm:ChangeRequest> 

You can get the list of supported actions in Eclipse by going Work Items > Team Artifacts > Right-click on Project Area > Open > Process Configuration Source tab. Search the displayed text for e.g. "com.ibm.team.workitem.activityWorkflow" to see Activity actions.

I'm using XML here but the same procedure should apply when using JSON.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!