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 Join to answer
Community showcase
Emilee Spencer
Published yesterday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

36 views 0 3
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot