2009-10-13 88 views
1

我正在嘗試編寫一個小型的Rails應用程序,它將使用Jira4R gem與Jira進行交互。但是,雖然我在創建問題時沒有任何問題,但我在將自定義字段附加到問題時遇到了麻煩。使用Jira4R創建JIRA問題

任何想法,我會如何做到這一點?

在我創建這個問題就像時刻:

issue = Jira4R::V2::RemoteIssue.new 
issue.project = "TEST" 
issue.summary = params[:issue][:summary] 
issue.description = params[:issue][:description] 
issue.type = 6 
issue = @jira.createIssue(issue) 

回答

4
issue = Jira4R::V2::RemoteIssue.new 
    issue.project = "TEST" 
    issue.summary = params[:issue][:summary] 
    issue.description = params[:issue][:description] 
    issue.type = 6 

    c = Jira4R::V2::RemoteCustomFieldValue.new 
    c.customfieldId = "customfield_10000" 
    c.values = current_user.full_name 

    issue.customFieldValues = [c] 
    issue = @jira.createIssue(issue) 
+0

你怎麼添加成分(S)? – rb512 2012-02-23 00:59:12