Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Tempo Team Name Scripted Field

Hello!

I've been trying to get the team name from the Tempo Team field in a Script Runner Scripted Field, but all I've been able to get is the ID using the following code :

import com.atlassian.jira.component.ComponentAccessor;

def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_12200");
def value = (String)issue.getCustomFieldValue(customField);

return value;

 Does anyone know if there is a way to get the name from the ID or even get the name directly?

 

Thanks,

JT

1 answer

I know it's been a while since the question was asked, but since there's no answer until now I'll share what I've been doing to get the Tempo team from an ID (if you have the team you also have the name).

Just paste below code into script console to test it.

import com.onresolve.scriptrunner.parameters.annotation.ShortTextInput
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.tempoplugin.team.api.TeamManager

@ShortTextInput(label="Team ID", description="Please enter an integer (if no team exists for this ID the script will output null)")
String teamId

@WithPlugin("com.tempoplugin.tempo-teams")
@PluginModule
TeamManager teamManager

// get the according Tempo team...
def team = teamManager.getTeam(teamId as Integer)

// ...and its name
def teamName = team?.name

 

However, it seems that at least for Jira 8.13.0, Scriptrunner 6.13.1 and Tempo 7.20.1 your code actually returns the team's name (according to the preview function of a scripted field).

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Why you should move agile planning to Lucidspark’s digital whiteboard

During my 17 years as a coach, mentor, and trainer of Agile teams, I’ve participated in hundreds of Agile planning meetings. The end result was a wall of backlog items annotated by an explosion of co...

102 views 0 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you