Hello - I have created a new ScriptRunner Custom Field called "Portfolio Team" to capture the value of the "Team" field which came with Portfolio for Jira. The problem I am having is related to the following query. I get no results. This field works fine in JQL.
SELECT distinct dbo.customfieldvalue.ISSUE,dbo.customfield.cfname,
CASE When customvalue is not null then cast(customvalue as varchar)
When NUMBERVALUE is not null then cast(NUMBERVALUE as varchar)
When TEXTVALUE is not null then cast(TextValue as varchar)
When DATEVALUE is not null then cast(DATEVALUE as varchar)
When STRINGVALUE is not null then cast(StringValue as varchar)
End as CustomValueFinal
FROM dbo.customfieldoption RIGHT OUTER JOIN
dbo.customfieldvalue ON dbo.customfieldoption.ID = try_cast(dbo.customfieldvalue.STRINGVALUE as numeric) RIGHT OUTER JOIN
dbo.customfield ON dbo.customfieldvalue.CUSTOMFIELD = dbo.customfield.ID
where cfname like '%Portfolio Team%'
Field Name: Portfolio Team
Searcher: Free Text Searcher
Template: Text Field (multi-line)
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def teamPortfolio = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_11900")
def teamValue = issue.getCustomFieldValue(teamPortfolio)
if (teamValue) {
return teamValue.getDescription().getTitle()
}
return null
Hi,
The values of Scripted Fields are not stored in the database: they are calculated dynamically when they are accessed via Jira. Hopefully this helps explain the behaviour you're seeing.
Yours,
Joanna Choules, Adaptavist Product Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.