Hi!
I'm trying to set the Team custom field value to the current team value of a context issue in a Behaviour script but the value is never set. I'm able to get the id and the title of the team of the context issue but when I'm using the setFormValue function on the Team custom field the Team value is never set. I've also tried the setting defaults for selects from the Scriptrunner docs but when I'm trying to get the options of the Team custom field it always returns an empty array (the link to the Scriptrunner doc: https://scriptrunner.adaptavist.com/5.5.5/jira/recipes/behaviours/setting-default-fields.html )
Here's a snippet of my code
Hello @Antoine Roy-Lachance ,
Is the team custom field of type Group ?
What is the "teamService" in the snippet ?
Hi Antoine,
The custom field is of type Team.
The team service is from a plugin of atlassian, I need it to get the team value
here's how I include it in my script:
@WithPlugin("com.atlassian.teams")
@PluginModule GeneralTeamService teamService
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Antoine,
I do not know about this plugin (and cannot find it). Could you please link its marketplace page ?
Behaviours usually uses the object Id or String to set the field value. If that does not work, maybe the teams plugins is not supported for this scripting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think it's marketplace plugin. It's based on the Team REST API from atlassian from what I understand. For my other issue fields I use thee getFieldById method to get the context issue field and then use the setFormValue to set the context issue field to the value of my issue but the Team custom field seems to work differently. I've tried to set the value of the Team custom field with it's team id and it's title but it didn't work.
Here's how I import the plugin for the teams in my script
To get the current team value, I use this function from the teamService with the teamId as the parameter
teamService.getTeam(TeamIdAsInt).get()
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.