The goal I'd like to achive, is to only show released and not yet archived versions in the Affects Version/s Field in JIRA Service Desk Customer Portal.
I tried this in vain using the new (and still awesome) Behaviours Service Desk support.
//getting version Manager
def versionsManager = ComponentAccessor.getVersionManager()
//getting the Affects Version/s Field
def versionsField = getFieldById("versions")
//getting all non-archived released versions
def releasedVersions = versionsManager.getVersionsReleased(issueContext.projectObject.id, false)
//setting them as FieldOptions for the Affects Version/s Field
When printing out all versions of this project and the ones in releasedVersions, I get the following result:
REL = only released and non archived versions
ALL = all versions
I tried this with and without the BaseScript import at the start of the script, but ...
@BaseScript FieldBehaviours fieldBehaviours
... I still got all the versions shown in the customer portal without any error. (What it the BaseScript line doing anyways?)
Does anyone know if this is a general problem at the moment or am I doing something completely wrong?
Thanks in advance!
Hi, slothstronaut! I have a similar problem with the script. When creating a new task in JIRA, script works ok, but if we create a new task in Service Desk portal, script doesn't work. Through the browser console I have such an error:
Behaviours post failed. TypeError: Cannot read property 'map' of undefined
at Object.a [as f] (batch.js?locale=en-US&sd_operational=true:1044)
at Function.e.setFieldOptions (batch.js?locale=en-US&sd_operational=true:1044)
at t.e.addFieldListeners (batch.js?locale=en-US&sd_operational=true:1044)
You get the same error?
no, "unfortunately" im not getting any error response in the logs. Maybe I am misinterpreting the docs.
i can see my script getting triggered, but it seems like the .setFieldOptions doesnt have any effect.
maybe we misunderstand each other, I've enabled logging for behaviour and also include logger to my script for debug. I can see my script is called during my browser
You faced similar bugs to what I reported about "select list conversion": https://productsupport.adaptavist.com/browse/SRJIRA-2667
It looks like jQuery "$" alias is not defined - and replacing "$." and "$(" in plugin js/bh-portal.js (by "jQuery." and "jQuery(") may be a work-around worth to try... waiting for Adaptavist to fix this Behaviour support.
I propose you to vote for my bug report, and I can vote for yours if you create one for your specific trouble.
maybe only an Adaptavist could clarify the situation here =)
If its generally possible to modify the customer portal of a service desk project via behaviours, or just the service desk project itself (inside normal jira without the effects on the customer portal).
Right. But the way "Behaviours with Service Desk" is documented: https://scriptrunner.adaptavist.com/latest/jira/behaviours-servicedesk.html
it sounds like any documented "behaviour use case" is expected to work in both JIRA and Customer Portal.
could you please check out this post? I would really appreciate it if you answered this question ;) Thanks!
Hi everyone, welcome to the kb articles for Opsgenie FAQs. I'm one of the Technical Support Engineers for Opsgenie who will be providing weekly posts on FAQs from customers. All alerts are ...
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