Hello,
I would like to know if there is any way that i could change the custom field ID.
For my DEV instance, if i have a custom field ID as 123456. When i import my project configurations to PROD, the custom field ID changes to some random number.
Was thinking of changing all my custom field ID's (around 500 custom fields) to make it same as in PROD. Because whenever I write a script, I need to change the values in it again in PROD.
Can someone help me with this.
Thank you
hello @Naveen .
unfortunately from my understanding, what you are trying to do is not possible. The custom field id is auto-generated and yes you can have a mismatch between the prod and the dev.
what we usually do before developing a new feature/script in dev is we update the data of the dev by the data of prod to align the ids and go from there.
another solution would be to use the name of the field, but you have of course to make sure that our names are unique :(...
Good luck
hello @Naveen ,
this is the easiest way: restore from backup
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have handled this issue in two ways: by identifying fields by name rather than ID, and by referencing ID based upon the environment.
e.g.
def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Customer Request Type")
or
boolean devEnv = ComponentAccessor.getApplicationProperties().getString("jira.baseurl").indexOf("jira-dev.MYDOMAIN.com") > -1
boolean testEnv = ComponentAccessor.getApplicationProperties().getString("jira.baseurl").indexOf("jira-test.MYDOMAIN.com") > -1
boolean prodEnv = ComponentAccessor.getApplicationProperties().getString("jira.baseurl").indexOf("jira.MYDOMAIN.com") > -1
at the top of my script, and then
Long linkTypeApprove = devEnv ? 10600 : (testEnv ? 10700 : (prodEnv ? 10850 : 0))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have 2 or more fields with the same name, you'll want to use the second approach. I'd try to avoid that situation, though, as that could cause headaches with JQL and possibly other areas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.