Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Team Calendar - Upcoming events not showing as view option

Jeanette Wheeler
April 15, 2013

I am testing upgrade of Confluence instance from V2.9 to V5 using installed Team Calendar evaluation version 3.1.5. Successfully imported my data from old Calendar plugin.
Would like to display a list of upcoming events on home page, but edit calendar does not include view option=upcoming events.

"Upcoming Events" does display on Dashboard but seems to be caught in endless loop & does not load properly.

I have uninstalled calendar & reinstalled to no avail.

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
PD Sheehan
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 Champions.
May 11, 2023

If you hover over the "getCustomFieldObjectByName" or approvers, you might see something about it being a list or collection.

And if you look at the name of that method, you will see that it is plural. 

These two things together mean "approvers" is actually a list of custom fields. And you can set a value on intended for a single field by giving it a list.

If you are confident you only have 1 custom field named "Approver", you can just add [0] at the end to get the "first item in the list of custom fields" returned by the method.

Then, I think you would still encounter another problem. I believe the "Approvers" field allows multiple values. As such, it will not like receiving a single user since it expects a list of users. So you need to give it a list, even if that list is a list of 1.

Try this

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()

def approversCf = customFieldManager.getCustomFieldObjectsByName('Approvers')[0]

issue.setCustomFieldValue(approversCf, [issue.reporter])
TAGS
AUG Leaders

Atlassian Community Events