mulesoft / jira-connector

JIRA is a proprietary issue tracking product, developed by Atlassian, commonly used for bug tracking, issue tracking, and project management.
http://mulesoft.github.com/jira-connector
Other
2 stars 8 forks source link

How to use update a custom field? #12

Closed dougbass closed 12 years ago

dougbass commented 12 years ago

My flow receives an input message with the custom field used to find the issue to update, and also the custom field to update in the 'found' issue.

For example, my input message is EXTERNAL-ID=22894, CUSTOMER-NAME=bass.

So I used the jira:get-issues-from-jql-search function to find the issue to update, ie, the issue that has the field EXTERNAL-ID set to 22894.

Now I want to call jira:update-issue, but the payload now contains the RemoteIssue object from the previous jira call. How do I get my CUSTOMER-NAME in the original input message?

federecio commented 12 years ago

Can you post your flow?

dougbass commented 12 years ago

Sure - I found a way to do this I think. Store the information from the original request using a message-properties-transformer. My flow looks like:

```


But now I get an NPE:

[10-31 11:15:08] WARN  JiraConnector [[esfjira-1.0-SNAPSHOT].UpdateIssueQueue.stage1.02]: An exception was thrown while invoking updateIssue: java.lang.NullPointerException
[10-31 11:15:08] ERROR DefaultMessagingExceptionStrategy [[esfjira-1.0-SNAPSHOT].UpdateIssueQueue.stage1.02]: 

---

Message               : Failed to invoke updateIssue. Message payload is of type: Arrays$ArrayList

## Code                  : MULE_ERROR-29999

Exception stack is:
1. null (java.lang.NullPointerException)
  org.mule.module.jira.api.AxisJiraClientHelper:101 (null)
2. Failed to invoke updateIssue. Message payload is of type: Arrays$ArrayList (org.mule.api.MessagingException)

##   org.mule.module.jira.config.UpdateIssueMessageProcessor:387 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)

Root Exception stack trace:
java.lang.NullPointerException
    at org.mule.module.jira.api.AxisJiraClientHelper.createRemoteFieldValues(AxisJiraClientHelper.java:101)
    at org.mule.module.jira.api.AxisJiraClient.updateIssue(AxisJiraClient.java:170)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

---

Thanks for your help!
federecio commented 12 years ago

You are getting a NPE because a field value is null and the code is trying to create an array. What I'm not sure, if Jira expects in this case a null value or an empty array.

I pushed a fix and a snapshot was deployed, can you check is working now?

dougbass commented 12 years ago

I did a new "mvn install" and the result is the same, with the NPE at the same line. Does it take a while to get the change?


From: federecio reply@reply.github.com To: dougbass dougbass1@yahoo.com Sent: Monday, October 31, 2011 12:24 PM Subject: Re: [jira-connector] How to use update a custom field? (#12)

You are getting a NPE because a field value is null and the code is trying to create an array. What I'm not sure, if Jira expects in this case a null value or an empty array.

I pushed a fix and a snapshot was deployed, can you check is working now?

Reply to this email directly or view it on GitHub: https://github.com/mulesoft/jira-connector/issues/12#issuecomment-2581902

federecio commented 12 years ago

Can you try running with -U option:

mvn -U clean install

That will force to update snapshots.

dougbass commented 12 years ago

The connector is correctly setting a custom field to a value.

I also need to be able to clear a custom field, ie, set it to null. How should we do this?

Also, I need to change the value of fields other than custom fields, eg, the description field. Putting 'description' int he field map doesn't seem to do anything.

Thanks


From: federecio reply@reply.github.com To: dougbass dougbass1@yahoo.com Sent: Monday, October 31, 2011 12:50 PM Subject: Re: [jira-connector] How to use update a custom field? (#12)

Can you try running with -U option:

mvn -U clean install

That will force to update snapshots.

Reply to this email directly or view it on GitHub: https://github.com/mulesoft/jira-connector/issues/12#issuecomment-2582264

federecio commented 12 years ago

Hey, can we open one ticket per issue? That would make more sense to other users finding information through the tickets. Thanks.

When you say 'clear a custom field', have you tried setting null as the field value?