Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to update/ write data to database which relate to JIRA project

Mangala Kalpani January 23, 2023

I need to update colum value  from In complete to Complete when the JIRA ticket status change from In Progress to Done. How I can achive that.Can I use REST APIs to do that?

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2023

Hello @Mangala Kalpani 

You cannot interact directly with the database when you are using a Jira Cloud subscription.

Are you saying that for issues that were in a status of "In Complete" you want that status to be renamed as "In Progress"? 

If I am understanding your problem correctly, that sort of change can be done without writing directly to the database.

Are you working with issues that are in a Company Managed project or a Team Managed project? That information will be shown at the bottom of the navigation pane on the left.

Essentially you just need to update the name of the Status. The Status's unique numeric ID is what is actually recorded in the issues and history. When you update the name of a Status, that change will automatically be reflected everywhere that Status value was used.

The process for making that update depends on the type of project you are using.

Note that if you are trying to update issues in a Company Managed project, then this sort of change can affect all Company Managed projects that used the same Status values.

Mangala Kalpani January 24, 2023

Hi @Trudy Claspill , Thank you for the response.

If I further explain about my question, I want to make an integration between JIRA and SQL server to push some data like issues, issue's status from JIRA, to be saved in my database for analytical purpose. How to achieve that?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2023

What problem are you trying to solve by creating your own SQL database for storing some of the Jira data? Could you accomplish the same with third party apps that are designed to extend the reporting capabilities for Jira?

Mangala Kalpani January 25, 2023

Hi @Trudy Claspill ,

We have a customized dropdown field, named as “RoleStatus”. Let’s say that it has two values that can be chosen by the user (Active / Inactive).

When the user updated the RoleStatus from “Active” to “Inactive” it will update in the Jira itself.

We are currently doing an evaluation on Jira.

What I want is that the updates/changes which occurred on the Jira to be pulled out from Jira and send it to an external DB which is located in my PC.

Is there any way to achieve it?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2023

If you build a web interface to your database located on your PC, you could use the Automation for Jira feature to create a Rule that would detect the change in the issue and execute a Web Request to update your database. I don't have the experience to advise you on creating a web interface to your database.

Alternately you could develop your own program to use the Jira REST API to extract information from Jira and develop your own code for push that into your database using whatever coding options exist for interfacing with your database.

There is also a python package that is a wrapper for some of the Jira REST API endpoints. I don't know if it wraps the entire Jira REST API.

There may also be third party products that could be added to Jira that would provide functionality for detecting changes and pushing those to an external database. That is not a scenario I've researched. You could search and review available third party apps in the Atlassian Marketplace.

Mangala Kalpani February 5, 2023

Thank you for the guidance.

Mangala Kalpani February 7, 2023

Hi @Trudy Claspill ,

I used JIRA automation feature to send data to database using a POST REST API with header values, used 'Send web request' feature which is available under Global Automation. But I received the below error code and message.   

img.PNG

 

Furthermore, I tested above REST API using POSTMAN and used Webhook site to verify whether the required data is received at the Webhook as we expected. In both cases it is success.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2023

When you use the Send Web Request action in an Automation Rule, the action is being executed from the Jira Cloud system out on the internet rather than from your workstation. Is the URL you used internet accessible?

Mangala Kalpani February 7, 2023

Yes. It is an internet accessible URL.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2023

403 is the "Forbidden" error.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403

Have you included in your Send Web Request action the necessary information for the Jira Cloud system on the internet to comply with authentication requirements to access your PC?

Mangala Kalpani February 8, 2023

Below image shows what are the fields that I have added information (Web request URL, Header, HTTP method, Web request body, Custom data).  Is there any other field which I need to add information.img1.PNG

Note - The pink color boxes are placed to hide the sensitive information for security reason.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2023

I am assuming that the system on which you database resides and the database itself require username and password to authenticate, even if exposed to the internet.

As such your request is going to have to either provide sufficient information to get past that authentication, or you have to disable the requirement for authentication, potentially exposing your system/database to intrusion from the internet.

I am not an expert on web requests or security, so I cannot provide technical guidance on these topics. And that type of guidance is outside the scope of user communities that are focused on Atlassian products, in my opinion. Yes, you are using Automation for Jira, but the issue is in the formulation of your web request to an unrelated system/web interface.

Here are two other posts that talk about use of the Send Web Request action, which also include information about authentication for their specific scenarios. Perhaps that will help guide you in figuring out how to manage authentication for your web request.

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

https://community.atlassian.com/t5/Jira-discussions/Jira-Automation-Rules-Send-Web-Request-and-APIs-protected-by/td-p/1568456

Mangala Kalpani February 16, 2023

Hi @Trudy Claspill,

Thank you for the information.

Regarding the below point you mention on Feb 09, 2023.

"And that type of guidance is outside the scope of user communities that are focused on Atlassian products, in my opinion."

If is outside the scope of user communities, could you please let us know the correct place to put this question, to get some help to resolve this issue.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2023

How to form a proper web request in general for accessing a given computer or a database on said computer is not specific to the Atlassian products. That I why I say such questions are, in my opinion, outside the scope of the Atlassian user communities that are focused on questions related specifically to the Atlassian products - Jira, Confluence, Bitbucket, etc.

You can find a variety of resources on the internet to learn about creating web requests. Try searching for the internet with this phrase to get started finding such resources:

how to create a web request with authentication

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events