How to update/ write data to database which relate to JIRA project
Asked by Mangala Kalpani:

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?


Answers:
author: Trudy Claspill
body: Hello [@Mangala Kalpani](/t5/user/viewprofilepage/user-id/5120496)

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.

comments: author: Mangala Kalpani
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) , 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?


author: Trudy Claspill
body: 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?


author: Mangala Kalpani
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) ,

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?


author: Trudy Claspill
body: If you build a web interface to your database located on your PC, you could use the [Automation for Jira](https://support.atlassian.com/jira-software-cloud/docs/automate-your-jira-cloud-processes-and-workflows/) 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](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/) 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](https://pypi.org/project/jira/) 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](https://marketplace.atlassian.com/).


author: Mangala Kalpani
body: Thank you for the guidance.


author: Mangala Kalpani
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) ,

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](https://community.atlassian.com/t5/image/serverpage/image-id/238541i98058EC227E029A3/image-size/large?v=v2&px=999 "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.


author: Trudy Claspill
body: 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?


author: Mangala Kalpani
body: Yes. It is an internet accessible URL.


author: Trudy Claspill
body: 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?


author: Mangala Kalpani
body: 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](https://community.atlassian.com/t5/image/serverpage/image-id/239170iFBFB8A55E1E2B543/image-size/large?v=v2&px=999 "img1.PNG")

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


author: Trudy Claspill
body: 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>


author: Mangala Kalpani
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011),

Thank you for the information.

Regarding the below point you mention on Feb[09, 2023.](https://community.atlassian.com/t5/Jira-Work-Management-Questions/Re-Re-How-to-update-write-data-to-database-which-relat/qaq-p/2265901/comment-id/6042#M6042)

*"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.


author: Trudy Claspill
body: 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**


Tags: cloud