开发者

JIRA API and jira4r gem

I would like to create an issue by jira4r gem a开发者_如何学JAVAnd attach it to special components. I use code as you see below.

jira = Jira4R::JiraTool.new(2, "http://example.com/jira/")
jira.login("robot", "robot")

issue = Jira4R::V2::RemoteIssue.new
issue.project = "ABC"
issue.type = "1"
issue.components = ['10000']
issue.summary = "Do somethigs"
issue.assignee = -1
jira.createIssue(issue)

but there is a problem that it return an error

SOAP::FaultError java.lang.IllegalArgumentException: array element type mismatch and it is caused by setting "components"

Do you have some ideas how to fix it?


yay! I found the solution, mb it helps someone

component = Jira4R::V2::RemoteComponent.new(10010)
componentlist = Jira4R::V2::ArrayOf_tns1_RemoteComponent.new.push(component)

issue.components = componentlist


According to http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client you need remote component instead of component id.

Smth like

issue.components = [Jira4R::V2::RemoteComponent.new('10000')]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜