Hi all,
Within a Jira workflow we have a set of steps which an issue goes through during its lifecyle. Each step in the workflow is linked to a workflow status, which we want to sync back to our own API. To clarify a bit more, we have a client that wants to have the status of his Jira issues to be synced back to our system as well.
Because all our clients are very important to us, we decided to create a Jira plugin(add-on) with a custom post function (written in Java), which he can install and add to his workflow, so each time a jira issue is moved to a different step, the post function is triggered, and the status is synced to our system.
The way we are trying to achieve this:
In the `execute` method of the post function class which extends from the AbstractJiraFunctionProvider, we basically check whether the ticket which was moved was actually linked to something in our system (by checking a custom value). We then also check the user who made the change and push this together with the status of the changed Jira issue to our system by using a post endpoint (restful api). For this call to be made, I first had to import a simple http client (OkHttp3) by using maven.
Before we can use this endpoint, there has to be a call made to our own api to retrieve a token (authentication). I would love to get some feedback on this. Do I have to create a "Jira plugin user" in my own system and retrieve the token with the same (hardcoded) credentials. Or is there a way to ask the user who installed the plugin to login just once and make Jira store that token, and retrieve it in the post function so I just have to make one call to update the status in our system. This plugin should at the end be reusable by other clients as well. Only thing we want to achieve for now is syncing the status of a jira issue back to our own system.
Thank you in advance! Would love to get some feedback on this one.
Hi @Mourad Ahy,
When the app is installed/enabled, you can catch that event and put in the logic to extract the token. The credentials for generating the token could be either provided using a front end UI or hard coded in the properties file.
If needed, you can discard the token when the app is uninstalled.
Further references:
Regards,
Ravi Varma
Hi @Ravi Varma
Thank you for your help, I appreciate it.
Is it possible to do this UI thingy just once when the plugin is installed by a client, and store the token which can then be retrieved during the post function execution?
Don't want to make the user login to our own system each time a ticket is moved to another step in the workflow.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mourad Ahy,
Yes, you should explore Configure screen for your app. JIRA administrator should be responsible for configuring the credentials.
Once the JIRA administrator submits the credentials, the token can be subsequently stored in JIRA database and used by the post function.
As per this design, JIRA Administrator is responsible for generating the token after installing the app and post function will perform the integration with the external system using the token stored earlier.
Hope this addresses your concern. If you find this useful, please accept the answer.
Regards,
Ravi Varma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ravi VarmaThanks, I've accepted your answer. You might want to have a look at this one as well. https://community.atlassian.com/t5/Jira-questions/Get-details-app-installation-handshake-from-within-the-Atlassian/qaq-p/1016856
Appreciate your input!
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.