I am making an integration app with jira,I want to retieve 3 details of my account(domain name,email,api token) within that app,I am using python flask to make that app,can you please help me with this?
Have you gotten pass the authentication system to enable connect with an instance?
whats that I didn't understand?
I didnt make any progressive steps in this issue,can you explain in detail?
Thankyou
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Harshit Somani
If you're integrating using flask, especially when creating a connect app. It's either you create with direct REST API using email and token or you use JWT (recommended).Take note that if you're using JWT, you won't have access to email addresses, you need a special API upon approval by Atlassian to be able to access such. However with direct API you can query those.
So my question is, were you able to at least connect to one of the API? Is only if you can do that, then you can retrieve information about the user or any user on the instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://docs.google.com/document/d/1GC9fSC61BtWhdoTLBZTHxUsNmPiY2wMmzT5OqvQuY80/edit?usp=sharing
@Prince Nyeche Can you look at my python code so that you will get clear understanding of it.Thankyou
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please can you put the codes on Github and remove any sensitive information from it, then share the link. I will have a look at it. currently, I think the docs you share might contain sensitive information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai @Prince Nyeche
Here is the link for my repository of my program in github,it dosent contain any sensitive information
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe with flask_atlassian_connect library, which uses JWT from what I read, you need to create a Client class. That Client class will have access to some fields such as baseurl, sharedsecret and clientkey which needs to be dynamically pulled, so an authentication can be created which can then be used to query the Jira endpoints.
From the code, is seems you want to collect some user input from forms which will then be posted to one of Atlassian's endpoint. Also, you shouldn't make two routes with the same paths e.g. @app.route('/') - this is confusing to flask. Your Atlassian descriptor file has JWT as none. do you just want to authenticate to Jira via REST API only or do you want to use JWT still? As the latter is much difficult to implement given what you want to insert.
If you simply just want REST API connection with email and api token to Jira. you can easily do that with the requests library or specifically to Jira cloud - you can use this library jiraone made by me and you can call endpoints directly.
basic usage is shown on the above link. you can integrate it directly to any Flask App. e.g.
from jiraone import LOGIN, endpoint
from flask import request, render_template, Flask
app = Flask(__name__)
@app.route("/index", methods=["GET", "POST"])
def index():
data = None
user = ""
token = ""
link = "http://example.atlassian.net"
LOGIN(user=email, password=token, url=link)
if request.method == "GET":
data = LOGIN.get(endpoint.myself()).json()
# some other expression here to has
return render_template("index.html", data=data)
if __name__ == "__main__":
app.run()
let me know if we're on the same page now? And how I can help further.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai @Prince Nyeche ,Am afraid my main query has not been answered
My main question is how can we fetch the fields called ('email','token','link') without manually typing them,according to the code you are asking to manually type these fields,how can we fetch them just by using code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's why I asked, if you want to use JWT. This is a much complex approach. The module you used flask_atlassian_connect can do that but understanding JWT is a bit complicated. Here's a module for atlassian_connect_jwt which explains how you can use it with python. Also, here's a quick explanation on JWT. However with JWT, you cannot fetch email addresses just like that, you require an Atlassian Approved API to query email addresses.
However, in order to understand your use case here, what exactly do you want to achieve with your add-on? Is your add-on suppose to impersonate any user to submit or make request? Please explain more on your use case, so i can get a clearer picture. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai @Prince Nyeche
My add on will add some devices as assets to the jira instance,I am following the procedure mentioned in the tab called "add assets via rest endpoint",there the user who installed my add-on will be needing my domainname,email and token.Instead of manually typing these fields I want to automate this process so that who ever installs my add-on will need not have to enter these fields manually when they want to add assets
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://developer.atlassian.com/cloud/assetsapi/introductions-and-basics/getting-started/
I was refering to this link in the above comment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looking at that requirement you need to use JWT in your connection to do what you want. the example given is just to demonstrate the possibility.
Connect apps have HTTPS and JWT authentication built in to secure communication between your app, Jira, and the user. Our Connect toolkits, Atlassian Connect Express (ACE) and Atlassian Connect for Spring Boot, handle most of the security setup for new apps. Note that OAuth 2.0 (3LO) isn't supported for Connect apps.
This is what is explained under the overview for Atlassian connect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.