We are evaluating the plugin and want to use the setting of project metadata in a workflow condition and/or scripted validator.
Does anybody have groovy code that works with Jira 7.2+ that reads the value of a given key?
Looks like my reply got edited away???
has what I really was looking for
Hi @Martina Riedel,
Please take a look at this similar question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks that was the post I couldn't find, got in working and pared down
The following works in a ScriptRunner script
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
def projectObject = issue.getProjectObject();
Issue myIssue = issue // needed for the getClass to work
// get named project metadata key, ignore the static checking error below, it works
def myKey = ComponentAccessor.getComponentOfType(myIssue.getClass().getClassLoader().findLoadedClass("com.atlassian.jira.plugin.JiraOsgiContainerManager")).getServiceTracker("com.osoboo.jira.metadata.MetadataService").getService().getMetadataValue(projectObject, "Key")
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.