Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Change the Custom Priority URL in database?

Shirley Tsai
Contributor
July 18, 2019

All,

We'd like to implement the automation for Jira development refresh. One of the procedures is to change the Custom Priority URL in Administrator (Issue -> Issue Attributes -> Priorities).  I tried to seek any Jira software API, but it seems not to have this request, only get them (rest/api/2/priority).  My question is can I change the priority URL in Database?  Will it impact others value in DB?

mysql <database> -h <db_host> -u <mysql_user> -p -e "UPDATE priority set ICONURL='<new_value>';

Thanks,

Shirley

1 answer

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2019

Hi,

I see that you are looking to find another way to change the icon URL for a priority in Jira.  You are correct that in the current versions of the REST API, there is not yet a way to do this.

Technically it might be possible to make this change via SQL, but there are some caveats with doing this.  First off, direct SQL changes are not officially supported by Atlassian.  So we would recommend that you create a SQL backup before you make such changes.

Secondly, if you make these changes while Jira is running, there is a potential problem here in the way that Jira caches that data.  Jira is expecting that only an administrator on the /secure/admin/ViewPriorities.jspa page will edit/change values there.  To have a SQL user making changes Jira is unaware of can cause some cached data to be invalidated unexpectedly.   Which is why if you are going to make these changes via SQL, it is far safer to do so while Jira is stopped.  This way restarting Jira will pull current values from the database and not rely upon existing cached data.

The other potential problem with doing this directly via SQL, Jira doesn't know if the image/URL being used is one that it can actually reach or not.  This is where the admin interface in Jira to set these values would be preferred.  That menu can prompt you for a file or a URL, and right away you would see in Jira if the path selected was one that Jira could not see an icon on.

Also in regards to your specific SQL statement there:  It looks like it would change the iconurl value for all iconurl entries in that table. I doubt you want to do that here.  Instead you will want to make sure that you use a where clause to identify a specific entry there that you want to change.  So instead of using:

UPDATE priority set ICONURL='<new_value>';

you would want something more like:

UPDATE priority set ICONURL='<new_value>' where id=10000;

or

UPDATE priority set ICONURL='<new_value>' where pname='Lowest';

for examples.

I hope this helps.

Andy

Shirley Tsai
Contributor
August 29, 2019

Hi Andy,

Thanks for bringing us a good suggestion.  So far we figured out the workaround and don't change any SQL schema.  Due to our custom icon name is the same with the default name, such as blocker.svg (default) and blockr.png (custom).  We tried to use the relative path in System -> issues -> priority, but it was not working and direct to block.svg icon. 

#Relative path

/images/icons/priorities/blocker.png

So that is why we refresh Jira to the development server, we have to use the full links and change the correct URL again.

#Full path

https://URL/jira/images/icons/priorities/blocker.png

Our workaround is to change the name, and different with default, such as blocker-p1.png.  Restart the service.  So far we can use the relative path to capture the icon.  

#Relative path

/images/icons/priorities/blocker-p1.png

If have any concerns, please correct me.  For now, we don't need the REST API requirement anymore. Thank you.

Have fun,

Shirley

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events