远程JIRA问题创建

时间:2013-04-10 14:26:39

标签: jira

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

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

1 个答案:

答案 0 :(得分:0)

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

〜马特

P.S。这个编辑器中的代码格式化程序非常糟糕!

#
# 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