【问题标题】:Linking between Jira issues in different projects链接不同项目中的 Jira 问题
【发布时间】:2012-08-08 00:38:51
【问题描述】:

JIRA SOAP API 是否允许我链接不同项目中的两个问题?我在网上查了一下,没有找到方法来做到这一点。我见过的最接近的东西是 createIssueWithParent 方法,它创建子问题(我希望将两个问题链接起来,而不是子问题)并且要求问题在同一个项目中(也不是我想要的)。

有谁知道这样做的方法吗?

【问题讨论】:

  • 我终于使用 REST 实现了这项工作,但我只能创建“重复”类型的问题链接。我想创建“与”链接,但将我的类型设置为“与”和“相关”等各种内容不起作用。有谁知道有效的链接类型?
  • 原来“相关”是我要找的那个。

标签: c# api soap jira


【解决方案1】:

在 SOAP 中没有简单的方法,但我已经使用 RESTful 方法和 JIRA 4.4 完成了这项工作,例如

#
# Add links to JIRA issues
#
# Matt Doar
# CustomWare
# 
# usage: create_links.sh issue_id issue_key
# where the issue_id is the unique id for a JIRA issue, not it's issue key.
# You can see the issue id in the XML view of an issue.
# and issue_key is the other issue to be linked to.

USERNAME=admin
PASSWORD=secret
SERVER_URL="http://localhost:8080"

DASHBOARD_PAGE_URL=$SERVER_URL/secure/Dashboard.jspa
COOKIE_FILE_LOCATION=jiracoookie

# Get the authentication cookie
curl -u $USERNAME:$PASSWORD --cookie-jar $COOKIE_FILE_LOCATION -sS --output /dev/null $DASHBOARD_PAGE_URL

issueid=$1
issuekey=$2
#echo "Linking issue: $issueid and $issuekey"
curl --cookie $COOKIE_FILE_LOCATION --header "X-Atlassian-Token: no-check" -sS --output /dev/null -d "id=$issueid" -d "linkDesc=relates to" -d "linkKey=$issuekey" "$SERVER_URL/secure/LinkExistingIssue.jspa"

rm -f $COOKIE_FILE_LOCATION

【讨论】:

    【解决方案2】:

    I don't think that linking is possible 通过 SOAP API。我使用XML-RPC APIcreateIssueLink 函数完成了这项工作:

    from com.atlassian.jira import ComponentManager
    # get issue objects
    authenticationContext = ComponentManager.getInstance().getJiraAuthenticationContext()
    issueLinkManager = ComponentManager.getInstance().getIssueLinkManager()
    # Link parent issue to subtask
    issueLinkManager.createIssueLink(issue.getId(),otherIssue.getId(),10003,1,authenticationContext.getUser())
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-28
      • 1970-01-01
      • 2023-02-19
      • 1970-01-01
      相关资源
      最近更新 更多