Some python_jira library of common operations

# coding:utf-8


import jira

 

# Jira parameter
Jiras = {
'URL': "http://192.168.15.150:8800", # JIRA address
'username': "qiujunjie", # login account
'password': "123456", # password
}

myjira = jira.JIRA (Jiras [ 'url'], basic_auth = (Jiras [ 'username'], Jiras [ 'password'])) # 创建 jira 链接


# Id Gets the project according to the project
# = the p-myjira.project (10003)
# Print (the p-)

# Loop through all the items
# for the p-in myjira.projects ():
# Print (the p-, p.id)

# Get the version below the specified item
# Print (myjira.project (10003) .versions)
# for ver in myjira.project (10003) .versions:
# Print (ver)

# Accordance with the conditions screened jira issue (filter condition is advanced filter criteria on jira) Note: This screening default mode the maximum number of 50, you need to add parameters = 1000 maxResults
# AND DELINQUENCY for in myjira.search_issues ( "Status = the AND to Resolved in Assignee (gongshijie) the Order by the Created DESC "):
# Print (AND DELINQUENCY)

# Gets the jira issue under the name
# myissues = myjira.issue ( "KOF- 38903")

# Get the list of attributes jira
# more specific properties by api jira query: HTTP: //192.168.15.150: 8080 / REST / API / 2 / Issue / the KOF-38935
# NOTE: The following attributes are part of a string , but some object, one may obtain further detailed information
# print (myissues.id) # defect ID
# Print (myissues.fields.issuetype) type #
# print (myissues.fields.issuetype.avatarId) # type ID
# print (myissues.fields.project) # item
# print (myissues.fields.fixVersions) # resolve version
# print (myissues.fields.resolution) # resolve result
# print (myissues.fields.resolutiondate) # resolution time
# print (myissues.fields.lastViewed) # View last time
# print (myissues.fields.created) # creation date
# print (myissues.fields.priority) # priority
# print (myissues.fields.customfield_10300) # tasks classification (custom field)
# Print (myissues.fields.versions) Affects version #
# Print (myissues.fields.assignee) # Attn
# print (myissues.fields.updated) # Date Modified
# print (myissues.fields.status) # state
# print (myissues.fields.components) # belongs module
# print (myissues.fields.description) # description
# print (myissues.fields.customfield_10601) # support needs of each group (custom fields)
# Print (myissues.fields.attachment) accessories #
# print (myissues.fields.customfield_10009) # testers (custom fields)
# Print (myissues.fields.summary) # topic
# print (myissues.fields.creator) # Creator
# print (myissues.fields.reporter) # Speaker
# print (myissues.fields.comment .comments) # comment


Jira modified list #
# myissues.update (assignee = { 'name ': 'lidanfeng'}) # modify managers
# myissues.update (customfield_10009 = { 'name ': 'lidanfeng'}) # modify testers, only changes can not be added (if the list had no testers, this method can not be used)

# Get jira user
# Print (of the type (myjira.current_user ()))
# Print (of the type (myjira.user (myjira.current_user ())))
# Print (myjira.current_user ()) # get the current user name (string )
# Print (myjira.user (myjira.current_user ())) # get the current user object (class)
# Print (myjira.user ( "qiujunjie")) # Gets the specified user object (class)

 

Guess you like

Origin www.cnblogs.com/dabaicai0703/p/11222549.html