0

我需要从我的 C# 实用程序将 JIRA 问题相互链接。

我无法使用 REST API,因为我的 JIRA 版本是 4.4,我无法升级。

4

1 回答 1

0

这很棘手,因为您必须使用的 SOAP 方法中没有 addLink() 方法。我使用 shell 脚本直接调用 URL,但您需要知道 JIRA 问题 ID,而不仅仅是问题键。我认为这适用于 JIRA 4.4 但不适用于 5.x

〜马特

ps 这个编辑器中的代码格式化程序太糟糕了!

#
# 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
于 2013-04-10T22:30:12.953 回答