Jira mobile connect not creating an issue in Jira from iPhone.

Akash Patel April 30, 2013

I have integrated JMC 2 weeks back and created an issue that time. But it still shows "Feedback in transit". I am using latest version.

4 answers

1 accepted

0 votes
Answer accepted
Akash Patel May 11, 2013

The issue was there because jira mobile connect user was not given create issue permission. After giving the permission the problem is solved.

0 votes
Antonio Malara May 6, 2013

We've decided to not go forward with our plans to integrate JMC in our products, so I will not go further in resolving this issue.

As a small result of my investigation, a better approach to fix this issue is to implement this NSURLConnection delegate method

- (NSInputStream *)connection:(NSURLConnection *)connection needNewBodyStream:(NSURLRequest *)request;

to recreate the stream that i commented on the patch in my previous answer.

That part of the JMC is a bit convoluted and it does not follow cocoa conventions, so it's a bit hard to shove that in, but this is the general direction I was trying to do.

Hope this will help you.

0 votes
Antonio Malara May 5, 2013

Hello Akash,

This is a bug in the iOS JMC.

I've a quick-n-dirty patch for it, but I know it's not 100% correct as it may crash the app for an out-of-memory if the user includes heavy attachments. In that case the only recovery is to DELETE the app.

While I'm working on a better solution, this should should be enough to get you up and running.

Hope it will work for you.
Antonio

diff --git a/JIRAConnect/JMCClasses/Core/transport/JMCTransport.m b/JIRAConnect/JMCClasses/Core/transport/JMCTransport.m
index 7be1c2f..05f96c9 100644
--- a/JIRAConnect/JMCClasses/Core/transport/JMCTransport.m
+++ b/JIRAConnect/JMCClasses/Core/transport/JMCTransport.m
@@ -159,16 +159,19 @@
             }
         }
     }
+

-    NSInputStream* inStream = [[NSInputStream alloc] initWithFileAtPath:postDataFilePath];
-
-    NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:postDataFilePath error:nil];
-
-    NSNumber *fileSizeNumber = [fileAttributes objectForKey:NSFileSize];
-    NSString* fileSize = [fileSizeNumber stringValue];
-    [request addValue:fileSize forHTTPHeaderField:@"Content-Length"];
-    [request setHTTPBodyStream:inStream];
-    [inStream release];
+    request.HTTPBody = [NSData dataWithContentsOfFile:postDataFilePath];
+//
+//    NSInputStream* inStream = [[NSInputStream alloc] initWithFileAtPath:postDataFilePath];
+//
+//    NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:postDataFilePath error:nil];
+//
+//    NSNumber *fileSizeNumber = [fileAttributes objectForKey:NSFileSize];
+//    NSString* fileSize = [fileSizeNumber stringValue];
+//    [request addValue:fileSize forHTTPHeaderField:@"Content-Length"];
+//    [request setHTTPBodyStream:inStream];
+//    [inStream release];
 }

 + (id)parseJSONString:(NSString *)jsonString {

(yeah, i said it was quick-n-dirty.)

0 votes
Akash Patel May 1, 2013

I enabled JMC_DEBUG and then ran my application. Alongwith other lines I saw this. Can anyone tell me, what does this mean?

[JMCTransportOperation connection:didFailWithError:] Request failed: request body stream exhausted.

URL: https://objectlounge.atlassian.net/rest/jconnect/1.0/issue/create?project=RIDESHARE&apikey=8418bedf-ef8b-431e-8f3b-7ba2f1d91fa4, response code: 0

Suggest an answer

Log in or Sign up to answer