1

I'm using the Atlassian .NET SDK to extract data from Jira OnDemand. I need to get more than 100 issues for a particular project. My problem is that if I set the maxIssues property to higher than 67, I get a CommunicationExceptions saying:

"Error in deserializing body of reply message for operation 'getIssuesFromJqlSearch'."

Any ideas how I can fix this?

var jiraConn = new Jira(url, user, password);

IEnumerable<Atlassian.Jira.Issue> jiraIssues = 
     jiraConn.GetIssuesFromJql("project = MAGNAMES", 67);

foreach (var i in jiraIssues)
{
    MessageBox.Show(i.Key + " " + i.Summary);
}

Server stack trace: at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Atlassian.Jira.Remote.JiraSoapService.getIssuesFromJqlSearch(getIssuesFromJqlSearchRequest request) at Atlassian.Jira.Remote.JiraSoapServiceClient.Atlassian.Jira.Remote.JiraSoapService.getIssuesFromJqlSearch(getIssuesFromJqlSearchRequest request) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Remote\JiraSoapService.cs:line 9445 at Atlassian.Jira.Remote.JiraSoapServiceClient.getIssuesFromJqlSearch(String in0, String in1, Int32 in2) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Remote\JiraSoapService.cs:line 9454 at Atlassian.Jira.Remote.JiraSoapServiceClientWrapper.GetIssuesFromJqlSearch(String token, String jqlSearch, Int32 maxNumResults) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Remote\JiraSoapServiceClientWrapper.cs:line 39 at Atlassian.Jira.Jira.<>c__DisplayClass8.<GetIssuesFromJql>b__7(String t) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Jira.cs:line 203 at Atlassian.Jira.Jira.<>c__DisplayClass37.<WithToken>b__36(String t) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Jira.cs:line 396 at Atlassian.Jira.Jira.<>c__DisplayClass3d`1.b__3c(String token, IJiraSoapServiceClient client) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Jira.cs:line 427 at Atlassian.Jira.Jira.WithToken[TResult](Func`3 function) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Jira.cs:line 446 at Atlassian.Jira.Jira.WithToken[TResult](Func`2 function) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Jira.cs:line 427 at Atlassian.Jira.Jira.WithToken(Action`1 action) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Jira.cs:line 394 at Atlassian.Jira.Jira.GetIssuesFromJql(String jql, Nullable`1 maxIssues) in c:\dev\atlassian.net-sdk\Atlassian.Jira\Jira.cs:line 201 at TicketReportService.ReportService.StartService() in c:\OSSTicketReportApp\TicketReportWebApp\TicketReportService\ReportService.cs:line 92 at TicketReportService.Program.Main() in c:\OSSTicketReportApp\TicketReportWebApp\TicketReportService\Program.cs:line 24 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
inga
  • 3,154
  • 1
  • 25
  • 29
  • This sounds like it might be a limitation in the Jira api. Can you add the stack trace? If it is a built in limitation, sounds like you'll need to paginate your self to get all of the issues. – Philip Pittle Aug 21 '14 at 11:28
  • @PhilipPittle I added the stack trace. If you look at the link below, the creator of the SDK suggests using a query and then Take(100) so according to that you should be able to get more than 67 results from a query. Therefore I hope it's not a limitation in the Jira api.https://bitbucket.org/farmas/atlassian.net-sdk-hg/issue/2/only-20-issues-per-search – inga Aug 21 '14 at 12:18
  • Another option is that issue number 68 contains some information that the `JiraSoapService` is unable to deserialize because of a formatting issue. You could try deleting this item and then recreating it later. Or use Fiddler to pull down the response from requesting 100 items and manually remove number 68. – Philip Pittle Aug 21 '14 at 12:22
  • @PhilipPittle You are right! There's something wrong with this particular issue. I created a query that only retrieves this issue but it throws the CommunicationException as well. Thanks for the help! – inga Aug 21 '14 at 12:39
  • Excellent, will leave it as an answer then. – Philip Pittle Aug 21 '14 at 12:55

1 Answers1

0

Make sure there isn't a particular problem with Issue number 68 that is preventing JiraSoapService from correctly deserializing the issue. Perhaps there is something in a comment or other WYSIWYG field that is breaking the deserializer.

Philip Pittle
  • 11,821
  • 8
  • 59
  • 123