

In addition, all pages on Bizapedia will be served to you completely ad freeĪnd you will be granted access to view every profile in its entirety, even if the company chooses to hide the private information on their profile from the general public. The script will only work every second time it will be called.Your entire office will be able to use your search subscription. Still doesn't work with latest JIRA and Scriptrunner versions. tLabels(user,issue.id,labels.toSet(), false, false) If(issue.getLabels().toString().contains( "already_created")) List links = linkMgr.getOutwardLinks(issue.id) LabelManager labelManager = ComponentAccessor.getComponent(LabelManager)ĭef linkMgr = ComponentAccessor.getIssueLinkManager()

Much more things do happen in a production Jira during a transition. The problem may be related to a timing problem. It seems the LabelManager is not that stable.īy the way, I neither can reproduce the issue on a fresh Jira with a simple workflow. It will set the label (OK), but if you delete it and set a random different label, next time the transition runs nothing happens. Now, start with an issue w/o any labels and perform a transition which has this script added to a post-function. Import .label.LabelManagerĭef user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()ĭef newLabel = ComponentAccessor.getComponent(LabelManager).addLabel(user, issue.id, CalendarWeekLabel, false) Expected is that it just adds labels.Ģ) I rebuilt it to set the calendar week: import .ComponentAccessor LabelManager.addLabel(myUser, issue.getId(), CalendarWeekLabel, false) ġ) it removes labels which are already set.
#CAL CODERUNNER CODE#
Still happening with all latest versions of JIRA, Code Runner, Script Runner. $log.warn( CalendarWeekLabel + "set as label.") LabelManager.addLabel(myUser, $issue.getId(), CalendarWeekLabel, false) $log.warn( CalendarWeekLabel + "to set as label.") String CalendarWeekLabel = String.valueOf(CalendarYear) + "-" + df.format(CalendarWeek) Ĭom. myUser = jiraAuthenticationContext.getLoggedInUser() Int CalendarYear = cal.get(Calendar.YEAR) Int CalendarWeek = cal.get(Calendar.WEEK_OF_YEAR) JiraAuthenticationContext jiraAuthenticationContext = ComponentAccessor.getJiraAuthenticationContext() ĭef issueManager = ComponentAccessor.getIssueManager()ĭecimalFormat df = new DecimalFormat("00.#") LabelManager labelManager = ComponentAccessor.getComponent(LabelManager.class)

Do it the second time and the label will be set. If you perform the transition on an issue the first time, it doesn't set a label.

Unfortunately, this doesn't work reliably. This is done as post-function during a transition using "Code Runner" plugin. I have a script which generates a value - and adds it as label.
