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

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

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

0 vote

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?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

164 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you