If I change the name of a custom field, will that affect filters, automation rules, SLAs etc.?

Hai-Minh Tran March 12, 2020

I want to change names of custom fields for them to be more clear and intuitive (e.g. from "cause" to "cause of downtime"). Will the name change however affect filters, automation rules, SLAs etc. where the fields have been used so that these suddenly will not work any more?

3 answers

2 accepted

0 votes
Answer accepted
Chozo March 12, 2020

Hi @Hai-Minh Tran
as @Krishnanand Nayak mentioned, if it's via customfield ID everything is alright.

You can check workflows where u have it used by ID or name via SQL .. something like:
" select * from jiraworkflows where ............... "

Behaviors, automation etc, i think you have to check it manually, I'm not sure. If someone has good idea at it, I would like to know it also. :)

0 votes
Answer accepted
Krishnanand Nayak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2020

It will impact all the filters, scripts etc, where you reference the filed by name. If you are referencing them using the custom filed id, then the name change will not impact.

Hai-Minh Tran March 12, 2020

Thanks for the quick response. Is there an easy way to get an overview over all the places where I a have used a custom field name?

Krishnanand Nayak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2020
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchRequestEntity
import com.atlassian.jira.issue.search.SearchRequestManager
import com.atlassian.jira.util.Visitor

def filtersWithField = []
def myCustomFieldRegex = ~/(.*?Whatever You Call This Field.*?)|(.*?cf\[12345\].*?)/
def searchService = ComponentAccessor.getComponent(SearchService)
def searchRequestManager = ComponentAccessor.getComponent(SearchRequestManager)
searchRequestManager.visitAll(new Visitor<SearchRequestEntity>() {
@Override
void visit(SearchRequestEntity filter) {
def jql = filter.request
if (jql.findAll(myCustomFieldRegex)) {
/*
You don't have to get the search request object
as I am doing here. However, if you want to programatically
update search requests, you'll need to get the SearchRequest object itself, as I'm doing here. The SearchRequestEntity is a bit quicker to get, so I'm using that for this loop that iterates through the
entire list of saved filters.
*/
filtersWithField << searchRequestManager.getSearchRequestById(filter.id)
}
}
})
log.warn filtersWithField
Krishnanand Nayak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2020

this is a solution that was posted earlier in the community ...but not able to fins the link to that post.

Berry Kersten August 17, 2021

Hi @Krishnanand Nayak thanks!

Just one question: how do I run that script? 

Cheers, Berry.

1 vote
Tobias Gasser January 20, 2021

@Hai-Minh Tran just had this question myself regarding automation:

I can confirm that if you e.g. set a component via automation and later change that components name, the automation will NOT set the component anymore.

It is still listed in the automation settings with the old name but only the one with the new name is actually selectable via the component drowpdown.

So caution is required here...

Matthew Richardson August 10, 2022

Thank you for posting about this, I was about to go down the what if automations change rabbit hole. Seeing this has put the custom field rename on the back pedal 😅

Suggest an answer

Log in or Sign up to answer