首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >不同项目中的Jira问题之间的链接

不同项目中的Jira问题之间的链接
EN

Stack Overflow用户
提问于 2012-08-08 08:38:51
回答 2查看 729关注 0票数 1

JIRA SOAP API是否允许我在不同项目中的两个问题之间进行链接?我已经在网上找过了,但没有找到这样做的方法。我见过的最接近的是createIssueWithParent方法,它创建子问题(我想要链接两个问题,而不是子问题),并且要求问题在同一项目中(也不是我想要的)。

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

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-08-09 06:14:28

在SOAP中没有简单的方法,但我已经使用RESTful方法和JIRA4.4实现了这一点。

代码语言:javascript
运行
复制
#
# 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
票数 0
EN

Stack Overflow用户

发布于 2012-08-08 13:48:35

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

代码语言:javascript
运行
复制
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())
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11856098

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档