getting error for existing behavior

Sumit Kumar
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.
September 13, 2015
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import java.text.SimpleDateFormat
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.ComponentManager
import com.atlassian.crowd.embedded.api.User
import com.atlassian.core.user.preferences.Preferences

FormField formComponent = getFieldById("customfield_XXXXXXX")
s=formComponent.getValue()
User user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
Preferences pres = ComponentAccessor.getUserPreferencesManager().getPreferences(user)
timezone=pres.getString("jira.user.timezone")
formComponent.setHelpText("<div class=\"description\"> Time in <font color=\"green\"><b>$timezone</b> </font> Timezone</div>")

 

 

 

JIRA Version : 6.4.9 

3.1.4

 

Error :

-------------------------------------

unable to resolve class com.atlassian.core.user.preferences.Preferences
@ line 10, column 1.
import com.atlassian.core.user.preferences.Preferences

-------------------------------------

                

1 answer

1 accepted

0 votes
Answer accepted
JamieA
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.
September 13, 2015

Hrm, I can reproduce that. Must be a classloader issue. When you say "existing behaviour", did this used to work? If so, in which version, of the plugin or JIRA?

I raised https://jamieechlin.atlassian.net/browse/GRV-794 to track this.

Sumit Kumar
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.
September 14, 2015

Hi Jamie, Yes , yesterday I have upgraded from Jira 6.1.7 to Jira 6.4.9. This behavior was working as expected and was used to display the timezone of the use in the custom date time fields. Below is the information for earlier version Jira version : 6.1.7 Behavior plugin : 0.5.10 now we have upgraded to script runner : 3.1.x Thanks for your response. Best Regards, Sumit

Jamie Echlin _ScriptRunner - The Adaptavist Group_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 14, 2015

OK, thanks Sumit, we will look at this soon.

Suggest an answer

Log in or Sign up to answer