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.
hello @Nani .
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 :(...
I have handled this issue in two ways: by identifying fields by name rather than ID, and by referencing ID based upon the environment.
def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Customer Request Type")
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))
Learn how to use two new reports for next-gen projects in Jira Cloud: Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events