繁体   English   中英

如何使用C#从JIRA检索自定义字段值?

[英]How to retrieve custom field values from JIRA with C#?

在具有LONDON,PARIS等的自定义字段“ PLACE”中存在一些默认值。如何从C#中的JIRA SOAP API检索这些默认值(London,paris)。 JIRA- JIRA 4.0和C#-.net framework 4.0。

如果未在SOAP API上进行设置,则可以使用XML-RPC进行此操作。 Python代码示例(可以更改为C#):

#!/usr/bin/python

# Refer to the XML-RPC Javadoc to see what calls are available:
# http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/com/atlassian/jira/rpc/xmlrpc/XmlRpcService.html

import xmlrpclib

# Jira connction info
#server = 'http://212.29.248.203:8080/rpc/xmlrpc'
server = 'https://your.jira.com/rpc/xmlrpc'
user = 'user'
password = 'password'
filter = '10302'
customfieldID = "customfield_10417"

s = xmlrpclib.ServerProxy(server)
auth = s.jira1.login(user, password)

# get list of issues
issues = s.jira1.getIssuesFromFilter(auth, filter)
for issue in issues:
        # get open since time
        for customFields in issue['customFieldValues']:
                if customFields['customfieldId'] == customfieldID :
                        print "found field!"+  customFields['values']

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM