You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Quite simple what I'm trying to do, I have an array of field configuration schemes (projectlessFieldConfigSchemes) that I would like to delete. I attempt the code below to remove just the first of the array.
This was a very confusing thread to follow. For anyone seeing this in the future here is the code to delete a set of field configurations by their ID.
import com.atlassian.jira.component.ComponentAccessor
def fieldConfigSchemeMgr = ComponentAccessor.fieldLayoutManager
def layouts = []
for (l in layouts) {
def layout = fieldConfigSchemeMgr.getFieldLayout(l)
fieldConfigSchemeMgr.deleteFieldLayout(layout)
}
Jeremy,
Thanks for this code snippet! Is this to delete a field configuration scheme, or just the field configuration/layout?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can delete the schemes in this way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
fieldConfigSchemeMgr.getFieldConfigScheme will get you the issuetype scheme, while the other gets you the field configuration scheme -> don't know why the naming is so weird in the API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Atlassian Community!
Immutable objects do not have function calls that change them, so your second try is always going to fail.
In your fist bit of code, I don't think your temp object contains anything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your interest. So the first bit of code is referring to an array of Field Configuration Schemes that I gathered via the command
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But you're not putting anything into the "temp" variable, unless you've not given us all the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did not, just put in the lines that led to the error since the full code is quite long and unnecessary. I have gone ahead and simplified the code with the error to be self-contained. FCS 13300 exists. I am certain there is something small I am missing, but can't find any working examples online either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very interesting development this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I still would love some insight into this as you would think that the method "getFieldConfigScheme" would return a Field Config Scheme, but I have gotten the code to work with
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am very confused by your postings of partial bits of code, so I am not sure what you would like a pointer to.
But I suspect it would be a part of https://docs.atlassian.com/software/jira/docs/api/9.3.1/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope, that's the documentation I referred to earlier that was not great, but I have answered the based question for myself and posted the code for others, so I'll go ahead and close the question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.