Can I create a jira connect app using python?

Harshit Somani January 15, 2021

I am trying to create and upload a jira connect app,can I do it with my pyhton instead of javascript,procedure with js is mentioned here https://developer.atlassian.com/cloud/jira/platform/getting-started-with-connect/
please let me know how this can be done

1 answer

1 accepted

1 vote
Answer accepted
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2021

Hi @Harshit Somani 

Welcome to community! You can be able to use any language to code on Jira Cloud. with Python you can use micro web-framework such as Flask or bottle or web-framework such as Django, the options are endless. You can incorporate bootstrap in your UI design instead of using the ADG3 called Atlaskit if you want. You will need to get more understanding of JWT to start up with though.

Harshit Somani January 17, 2021

@Prince Nyeche  I have created an app using python(flask,flask-ngrok).I am able to load the apps successfully with the links(in my case link is 'https://618834426a38.ngrok.io') generated using flask-ngrok.
But when I am uploading it as an app to jira its showing "Problem accessing the file https://618834426a38.ngrok.io/basic.json" error message,can you please help me with it

Like Jérôme VACHER likes this
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2021

Hi @Harshit Somani 

Your connect file should be "atlassian-connect.json" where it contains the configuration.

Like Jérôme VACHER likes this
Harshit Somani January 20, 2021

@Prince Nyeche  ,yes  I did it so,my app is normally working in the browser, Screen Shot 2021-01-21 at 10.00.04 AM.pngScreen Shot 2021-01-21 at 10.01.56 AM.pngScreen Shot 2021-01-21 at 10.02.39 AM.pngand when I install the app in jira,it is not even opening,I used ngrok to host the app,Are there any prerequisite steps I have to follow if I use python flaskScreen Shot 2021-01-21 at 10.04.54 AM.png

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2021

Hey @Harshit Somani 

Can you check on your developer's console to see what type of error that is thrown? that should add context on what's the problem. 

Harshit Somani January 21, 2021

@Prince Nyeche Screen Shot 2021-01-21 at 4.38.05 PM.pngI am not able to figure out the problem

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2021

Can you check under the network tab while refreshing the page, to see the error message there?

Harshit Somani January 21, 2021
Harshit Somani January 21, 2021

@Prince Nyeche ,now I am getting the above errors,I used python ngrok flask for deployement,in the begging it gave a warning that "this is a development server do not use it in a production deployment",what can I do

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2021

Hey @Harshit Somani 

it seems that your ngrok is loading an insecure page, each time you load it up do you get a different url? Can you ensure that it's using https rather than http. 

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2021

I don't think the production environment has anything to do with it, because the example from Atlassian developer blog does work. so check other factors such as the https thing.

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2021

Hey @Harshit Somani 

What's the status on this issue, did you happen to rectify it?

Harshit Somani January 25, 2021

@Prince Nyeche ,Sorry for the delay,I was not able to rectify it,I am still stuck there.

you are suggesting to use https instead of http,I think thats what I did,but still can you tell me what is the best way to do it?for your reference I will give you the code,Please let me know the solution

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2021

Hi @Harshit Somani 

I tested your code from here, while it is able to load via ngrok.io when installed on an instance, it returns 404 when fetching the index page. Most probably due to the tunneling or being embedded on an iframe, which makes the page not to be retrieved. (not fully certain here)

127.0.0.1 - - [25/Jan/2021 21:15:20] "GET /index.html?xdm_e=https%3A%2F%2Fexample.atlassian.net&xdm_c=channel-com.example_test.myapp__hello-world&cp=&xdm_deprecated_addon_key_do_not_use=com.example_test.myapp&lic=none&cv=1001.0.0-SNAPSHOT HTTP/1.1" 404 -

127.0.0.1 - - [25/Jan/2021 21:18:06] "GET / HTTP/1.1" 200 -

I will suggest, you use Heroku instead to host this test app in order to run your test.

Harshit Somani January 25, 2021

@Prince Nyeche 

I'll try and let you know

Harshit Somani January 27, 2021

@Prince Nyeche ,I tried to deploy using heroku, here is the link https://harshitsomani26.herokuapp.com/static/basic1.json

Harshit Somani January 27, 2021

 

@Prince Nyeche  Thankyou soo much for the help its woking

 

Harshit Somani January 27, 2021

@Prince Nyeche ,does jira accept specical charcters which need to be encoded using utf-8,can you please guide me regarding this

Harshit Somani January 27, 2021

@Prince Nyeche ,I am trying to add asset panel through the same app,but it seems like not working,can you help me with itScreen Shot 2021-01-28 at 12.17.59 AM.pngScreen Shot 2021-01-28 at 12.15.00 AM.png

Harshit Somani January 27, 2021
Harshit Somani January 28, 2021

@Prince Nyeche ,can you help me with this?

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2021

Hi @Harshit Somani 

Can I confirm with you,  is the app now able to connect using heroku or are you still having the error?

Harshit Somani January 28, 2021

@Prince Nyeche ,yes it is connecting

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2021

@Harshit Somani  glad to hear that. I think what you can do here,  is to create and use an automated user credential (API token and email) via rest to authenticate putting of the asset once clicked.

Harshit Somani January 28, 2021

@Prince Nyeche ,i didnt understand can you please elobarate

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2021

@Harshit Somani  I meant you should authenticate the request you're posting

Harshit Somani February 1, 2021

@Prince Nyeche ,I am sorry but I think I was not able to explain the problem clearly,I'll do it again
To view the Iframe in the app,this(the image atttached) is how it is prescribed to give commandsScreen Shot 2021-02-01 at 4.02.00 PM.pngScreen Shot 2021-02-01 at 4.03.14 PM.png

Harshit Somani February 1, 2021

@Prince Nyeche  But I wont be able to give the same because I wont access the iframe directly I will access the Iframe from my python flask,so here how can I give the commandsScreen Shot 2021-02-01 at 4.06.03 PM.png

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2021

Hey @Harshit Somani  

Basically that is just an endpoint. on flask, you can create an endpoint as sample_iframe.html and have query parameter with the url and you can use a variable rule to write out the string you want flask to receive in the function. The url_for function is particularly what you will use this for.

you can also look into of the ways to capture those values by using the args property in the request and then process it. I think you should really explore more on flask in order to know how it can be done.

Harshit Somani February 2, 2021

@Prince Nyeche ,I don't think I have much problem over there,my main problem is when I include the module named 'asset panel' as shown in the above image,all my previously addable assets are getting deleted,if I don't include that module everything is working fine,whats the problem with that module

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 2, 2021

@Harshit Somani I'm not particularly sure why probably you can perform some troubleshooting steps to determine why it happens.

Harshit Somani February 3, 2021

@Prince Nyeche  why is that I am able to display only appkey,originId and not imei,os_version in jira's Iframe,I am able to display all of them in the web but not able to do so in Jira iframe. Screen Shot 2021-02-04 at 12.34.43 AM.pngScreen Shot 2021-02-04 at 12.35.25 AM.pngScreen Shot 2021-02-04 at 12.36.44 AM.pngScreen Shot 2021-02-04 at 12.37.26 AM.pngScreen Shot 2021-02-04 at 12.37.59 AM.pngScreen Shot 2021-02-04 at 12.39.22 AM.png

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2021

@Harshit Somani according to the docs for PUT method, it accepts origin being a dict, however I'm not sure if that includes additional fields other than appKey and originId.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events