2013-04-10 74 views
0

我需要從我的C#工具鏈接JIRA問題。遠程JIRA問題創建

我無法使用REST API,因爲我的JIRA版本是4.4,我無法升級。

+0

你到目前爲止看過或嘗試過什麼? – 2013-04-10 14:45:20

+0

我試圖用SOAP來製作它。 – 2013-04-12 14:30:57

回答

0

棘手的是,因爲SOAP方法中沒有addLink()方法,所以必須使用它。我使用shell腳本直接調用了URL,但您需要知道JIRA問題ID而不僅僅是問題關鍵字。我想,這曾與JIRA 4.4但不低於5.x

〜馬特

附:在這個編輯器中的代碼格式化器是可怕的!

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

感謝您的幫助,我會從我的代碼發送此請求。 – 2013-04-12 14:32:13

+0

我正在使用WebRequest(.NET),在標題中使用'='分隔符時出現錯誤。改用':'代替。 – 2013-04-18 12:48:30