You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This page constitutes random notes from my work day as an Atlassian product consultant, put up in the vague hope they might benefit others. Expect rambling, reference to unsolved problems, and plenty of stacktraces. Check the date as any information given is likely to be stale.

Tempo has a Team custom field. Here it is rendered in the Issue Navigator:

Sadly, if you view Team in CSV you get:

And likewise the view in the Excel-like Issue Editor plugin:

I have reported this as a bug to Tempo (10.17.x) but it's basically "Won't Fix". The field's native representation (i.e. issue.getCustomFieldObject() ) is a String like "52".

Fortunately we have ScriptRunner. Here is source for a Script Field called Tempo Team Name which renders the actual team name:

/**
 * 'Tempo Team Name' script Field that renders the issue's Tempo Team name, if any.
 * The plain tempo 'Team' field renders as an integer in CSV and Issue Editor views.
 * Use this field instead to render the team name.
 * 
 * https://www.redradishtech.com/pages/viewpage.action?pageId=24641537
 * jeff@redradishtech.com, 23/Jul/20
 */
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin

def customFieldManager = ComponentAccessor.customFieldManager
def teamField = customFieldManager.getCustomFieldObjects(issue).find { it.name == "Team" }
if (!teamField) return;

def team = issue.getCustomFieldValue(teamField)
if (!team) return;

@WithPlugin("com.tempoplugin.tempo-teams")
import com.tempoplugin.team.api.TeamManager
import groovy.transform.Field
import com.onresolve.scriptrunner.runner.ScriptRunnerImpl

@Field TeamManager teamManager
teamManager = ScriptRunnerImpl.getPluginComponent(TeamManager)
teamManager.getTeamName(team)

Here it is:

This field can now be used in CSV and Issue Editor views to see the team names.

  • No labels