Hi,
We would like to add a lot of additional Resolution values that will be used by specific issue type -Bug, however it shouldn't affect (be available to) the rest of issue types.
Since we are running over 300 projects, we would like to avoid a lot of manual job - configuring workflows properties.
I fount a hint here:
https://jira.atlassian.com/browse/JRASERVER-65924
As it was mentioned by Roger, script runner may help to achieve this goal. So I added behaviour and following code to Initialiser:
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
if (getAction() != null) {
def constantsManager = ComponentAccessor.getConstantsManager()
def allowedResolutions = constantsManager.getResolutions().findAll {
it.name in ["Fixed", "Won't Fix", "Duplicate", "Incomplete", "Cannot reproduce", "Invalid", "Done", "Resolved", "Won't Do", "To Decide"]
} getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)}
I'm getting error message {Static type checking} - Cannot find matching
method com.atlassian.jira.config.ConstantsManager#getResolution(). Please check if declared type is right and if the method exists.
We are running Jira 7.6.4.
Hello @Oleksandr Chalyi
Check your code and it works
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
if (getAction() != null) {
def constantsManager = ComponentAccessor.getConstantsManager()
def allowedResolutions = constantsManager.getResolutions().findAll {
it.name in ["Fixed", "Won't Fix", "Duplicate", "Incomplete", "Cannot reproduce", "Invalid", "Done", "Resolved", "Won't Do", "To Decide"]
}
getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)}
But this is bad
} getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)}
place getFieldById on the new line.
And you can try to ignore static type checking. Because it happens because compiler doesnt know about dynamic objects at this stage, but in runtime will be work well.
Thank you, Mark, for your prompt response. It works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You re welcome! If it helps you, please mark answer as accepted. So that, other people will be able to find this answer easily for similar questions :)
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.