Scriptrunner behaviors: How can I set a default value for Portfolio's "Team" field in JIRA?

Kelly July 13, 2017

I have a custom issue type with its own workflow. A specific Portfolio team will always be designated for that kind of work. Upon issue creation in JIRA, I want to set the default value for the Team field as that particular team.

I had this working fine previously when I used the JIRA Suite Utilities plugin. However, that plugin is no longer free, and I have been asked to adjust my workflow to utilize Scriptrunner instead because our studio has an active subscription to that.

Since JIRA currently treats Portfolio's "Team" field as a custom field (but limited to system level, so it can't be changed), how can I access it through Scriptrunner's behaviors? I've tried using the actual field name as well as the customfield_#### ID.

We're using these versions:

JIRA Software (Server) 7.1.9

Portfolio for JIRA 2.2.2

Scriptrunner 4.3.16 

1 answer

1 accepted

1 vote
Answer accepted
Aidan Derossett [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2017

Hey Kelly,

I've seen your support ticket with ScriptRunner and will be posting this same reply there just in case.

So I have been looking into this for a solid hour or two now with not much luck. I've worked through multiple possible routes to finding an explanation and have now returned with only greater confusion.

I was unable to set the Team custom field under any context via the Atlassian API, and so I am now fairly confident that this is an issue on their end. Because of this, I've gone ahead and raised a bug request with Atlassian regarding this issue, and will be keeping you updated about what I find.

But as of right now, it appears that there is no way to set the Team field with a Behaviour or any other process.

I'm sorry I couldn't be of more help, but hopefully I'm provided some useful information throughout my collaboration with the Atlassian Support team!

Let me know if you have any questions or would like me to elaborate on anything! :)

Thanks!
Aidan

Kelly July 18, 2017

Hey Aidan,

Thanks for looking into this and raising a ticket with Atlassian! While I'm sad that ScriptRunner can't access the Team field, I'm at least happy to know that I'm not completely crazy in my approach. I hope that Atlassian will work with you on finding a solution for this. I think it's great for Adaptavist to actively pursue more compatibility with Portfolio. I look forward to seeing what we'll be able to do with it in the future. Keep up the awesome work! :)

Jonny Carter September 22, 2017

Just to add to what Aidan wrote, part of the underlying problem is that JIRA Portfolio doesn't have a published Java API (see https://jira.atlassian.com/browse/JPOSERVER-1814), and many of their custom fields are inaccessible via the normal Atlassian JIRA APIs.

Daniel Jones [TNG] September 26, 2018

Since JPOSERVER-1814 seems to be resolved, any updates here? Thanks!

DSC-NickS
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 10, 2018

Are there any updates to this? We're trying to do exactly the same thing.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events