Query related to Scripted Field OR any other approach to get duplicated custom field

dhaval soni
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 16, 2013

Is scripted field appear on ISSUE EDIT or any transition screen ?

As now, for me, it appear on issue view screen only and unable to see on issue edit screen.

I want it to appear on EDIT screen as well as a readonly.

(have verified by just keeping - "free text template" and - return "some value").

Another:

When i have use below script on scripted field then it shows me error while execute :

Error message as below:
The indexer for this field expects a java.lang.String but
the script returned a com.atlassian.jira.issue.fields.CustomFieldImpl - this will cause problems.

Code:

import com.atlassian.jira.ComponentManager

import com.atlassian.jira.issue.fields.CustomField

import com.atlassian.jira.issue.CustomFieldManager

CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()

def componentManager = ComponentManager.getInstance()

def issueLinkManager = componentManager.getIssueLinkManager()



def selectedValues = customFieldManager.getCustomFieldObject("customfield_11447")
//custom field has multi selected values as it is a "multi select" field type.

return selectedValues

How i could use scripted field in issue edit/transition screen and also resolve above error.

OR

any other approach to get duplicated custom field on issue EDIT screen, i will be fine on javascript or any way.

basically, during create isssue screen, there are coupleof fields (calendar, multi select) which needs to be populate on EDIT issue screen under additional tab but, by default, unable to add that fields as its already existed in same screen in first tab.

Please let me know if need more details.

thanks

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 16, 2013

Mmm, the error message is not exactly clear, but I suspect you've created your own custom field *Type* here, and not got the indexing correct. I say that because you mention "text searcher", but the code says "multi select". Following this train of thought further, I suspect your code might be allowing for one type of searcher to be added to the field, but you've allowed a completely inappropriate type. A text searcher won't work on a field holding options, and a select searcher won't work on a text field. This goes on to break your field and your script because the index is incompatible with what the field asks for when the script runs.

Is my guesswork right? If not, then could you explain what type of standard custom field you have, and what the searcher is?

0 votes
dhaval soni
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 16, 2013

I am still looking in this if any one can help me.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events