Created
April 26, 2011 23:26
-
-
Save ericanderson/943404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proj_id = 10010 | |
search_svc = jira.component_mgr.getSearchService | |
q = search_svc.parseQuery(jira.user('eanderson'), "project=qa and Customer is not empty").getQuery | |
res = search_svc.search(jira.user('eanderson'), q, com.atlassian.jira.web.bean.PagerFilter.getUnlimitedFilter()) | |
res.getIssues.each do |issue| | |
cf = jira.custom_field(issue, "Customer") | |
issue.getCustomFieldValue(cf).split(",").map{|x| x.strip.gsub(' ', '_')}.each do |label| | |
jira.label_mgr.addLabel(jira.user('eanderson'), issue.getId, 10480, label, false) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
issue = jira.get_issue('QA-45047') # FIXME: hack for development | |
cf = jira.custom_field(issue, "Customer") | |
labels = issue.getCustomFieldValue(cf).split(",").map{|x| x.strip.gusb(' ', '_')} | |
labels.each do |label| | |
jira.label_mgr.addLabel(jira.user('eanderson'), issue.getId, 10480, label, false) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment