Marketcircle / jiraSOAP

Ruby interface to the JIRA SOAP API
http://rdoc.info/github/Marketcircle/jiraSOAP/master/frames
MIT License
31 stars 13 forks source link

JIRA::Project#soapify_for_msg lacks permissionScheme part of the message #21

Open paulvt opened 10 years ago

paulvt commented 10 years ago

As the SOAP interface seems to be the only way to create a project via any API with JIRA, I'm trying to do this with jiraSOAP. However, it turned out that the projects I created had no permission scheme which leads to null-pointer errors in JIRA itself.

When I found out that in all examples at least a permission scheme needs to be set (other schemes seems to have sane defaults), I also found out that jiraSOAP doesn't add a permission scheme with it's set ID to the message, hence, no viable projects can be created. I fixed it by adding the following to lib/jiraSOAP/entities/project.rb:

class JIRA::Project < JIRA::DescribedEntity
  ...

  def soapify_for msg
    ...

    msg.add 'permissionScheme' do |submsg|
      submsg.add 'id', @permission_scheme.id
    end if @permission_scheme
  end
end