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

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

Accepted Answer
0 votes

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

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

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.)

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

25,934 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you