How To Create SLA By Direct Insert into Database?

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

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.

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
Community showcase
Asked Dec 06, 2018 in Jira Service Desk

Looking for teams who switched from email to Jira Service Desk

The Jira Service Desk marketing team is working on a guide to help new Atlassian customers switch from email to JSD and we'd love to hear from you! Please share: - What made you realize that i...

762 views 6 10
View question

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you