In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to use the rtcclient module in python. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Install rtcclient.
Ps: the linux I use is Centos7, and the version of python that comes with it is 2.7.
2.1Install pip.
| | yum install python-pip-y |
If No pachage python-pip available. At this point, you need to update your expansion pack by entering the following command: | yum-y install epel-release
At this time, just go back and install pip.
2.2 install rtcclient
| | pip install rtcclient |
2.3 Test import
Import indicates that rtcclient has been installed successfully.
(3) read workitems in RTC. 3.1Connect to rtc
Url is the uri of rtc ccm. If you log in using the admin user of jazz, you can see it on the change management home page, as shown below:
Due to problems with the url configuration of individual jazz, if the above code cannot successfully connect to the rtc. You need to specify ends_with_jazz=False. Ends_with_jazz=False when connecting to rtc.
| | myclient = RTCClient (url,user,password,ends_with_jazz=False) |
3.2 get all the workitems in the project area
| | print myclient.getWorkitems ("your project area name") |
3.3 query specific workitem types
The most common workitem obtained are tasks and missing items, as shown in the following code:
Dc:type= "task" represents a workitem that looks up a type of "task". So what's the flaw? The customer views in the work items area configured in the manage Project area of change Management, as shown in the following figure:
Here you can see that the defect is identified as defect. So you can use the dc:type= "defect" query. It should be mentioned here that Return_prop is optional, but I strongly recommend adding it, because if not, rtcclient will get all the properties of workitem, which can be quite time-consuming. The following chapter explains the properties of workitem in detail.
4 attributes of Workitem
Dc:type mentioned above is an attribute of workitem. After obtaining a specific workitem, you can print its value directly using the following code:
What other attributes of workitem can be obtained with the following code:
| | print workitem.field_alias.values () |
Here are all the properties of workitem for one of my task types:
After reading the above, do you have any further understanding of how to use the rtcclient module in python? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.