How To Create SLA By Direct Insert into Database?

KEITH TYSON November 20, 2017

I have created an SLA through the application (Service Desk) successfully, however, I have so many different SLA's for each customer that it is easier to create all the goals by directly inserting them in the database.
I can see the SLA in AO_54307E_TIMEMETRIC and AO_54307E_METRICCONDITION as well as a goal in AO_54307E_GOAL. When I add another goal, I can see it being inserting into AO_54307E_GOAL.

I have created scripts to INSERT each goal into the AO_54307E_GOAL table. I can select these rows for the table and copy the JQL_QUERY and successfully use it in the application (Issues List).
However, the SLA goals I insert are not visible when I open the SLA in JIRA?

Please can anyone help as I do not want to have to manually create hundreds of SLA goals through the JIRA application?

Thank you.

INSERT INTO AO_54307E_GOAL (DEFAULT_GOAL, ID, JQL_QUERY, POS, TARGET_DURATION, TIME_METRIC_ID, TIME_UPDATED_DATE, TIME_UPDATED_MS_EPOCH, CALENDAR_ID) VALUES (0,0,'"Select Company"="XYZ Bank" AND "Select Country"="Tanzania (TZ)" AND ("Issuetype" = "Hardware Request" OR ("Issuetype" != "Hardware Request" AND "Business Unit"="Payments")) AND ("Confirmed Severity"~"1" OR ("Confirmed Severity" is EMPTY AND "Logged Severity" ="1 - System Down"))',0,3600000,0,NOW(),UNIX_TIMESTAMP(NOW()),6);

 

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2017

It doesn't work because Jira needs its data to be written into it via the API.

You should NEVER write to a Jira database when it's running, and when it's offline, it's for very specific bug fixes.

You should revert your database to the backup you took before you made these inserts, throw away your SQL and never look at the database again.

KEITH TYSON November 20, 2017

Thank you Nic.
I tried this in our TEST environment so all good to restore.

Do you know which of the JIRA API's offer creation of SLA goals?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events