Forums

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

Argument of type '"customfield_10687"' is not assignable to parameter of type '"customfield_10689" |

Ramez Kaupak August 28, 2023

I am trying to edit a custom filed. but i can not do anything. it gives an error.  i am using script runner for behaviours.

i have no problem editing other custom fields and even assigning aliases to them. but this field (cascading select) does not want to cooperate. i just need to set it to visible and invisible. please help. 

 

Argument of type '"customfield_10687"' is not assignable to parameter of type '"customfield_10689" | "customfield_10630" | "customfield_10510" | "customfield_10621" | "customfield_10500" | "customfield_10622" | "customfield_10624" | "customfield_10625" | ... 299 more ... | "priority"'.(2345)

 

 

const question=getFieldById("customfield_10689")//Is the issue related to specific components or process plans?
const title=getFieldById("customfield_10688")// title
const work_number_serial=getFieldById("customfield_10690")//work_order_number
//customfield_10691 how much time
//customfield_10687 process plan selection

work_number_serial.setVisible(false)
//getFieldById("customfield_10691").setVisible(false) //how much time
getFieldById("customfield_10687").setVisible(false)// process plan selection
if(getChangeField().getName() == question.getName()) {
    if (question.getValue().value == "Yes"){
        work_number_serial.setVisible(true)
        title.setValue("is related")
    }
    else if (question.getValue().value == "No") {
        title.setValue("not related")
    }
    else{
        title.setValue("did not recognize an asnwer")
    }
}
else {
    work_number_serial.setValue("did not recognize the field")
image.png

1 answer

0 votes
Trudy Claspill
Community Champion
August 28, 2023

Hello @Ramez Kaupak 

This is a bit of a guess based on my experience as a code developer, though I have not worked much with Java.

My guess is that the problem is you have not assigned the field object for customfield_10687 to a variable before trying to change its setVisible property.

See how you have declarations at (1) for the field objects for other custom fields? I believe you need to do the same for customfield_10687. Then at (3) you need to use setVisible the same way you do at (2), using the appropriate variable that you created for it in the declarations at (1).

Screen Shot 2023-08-28 at 5.57.39 PM.png

Ramez Kaupak August 28, 2023

thank you for your answer. 

I tried that but it creates the same error. image.png

Ramez Kaupak August 28, 2023

in this case i used a different custom field. but they both behave the same way. not sure why. 

one is a cascading answer field and the other is a numerical entry. both give the same error. 

textual or single select fields work no problem.

Simh Simh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2023

Hi Ramez,

Was there a fix for this issue?

Thanks,

Pavithra

Ahmed Saci November 16, 2023

Hi @Trudy Claspill @Ramez Kaupak @Simh Simh ,

 

Me too I am waiting for the solution to this problem.

I noticed that this error only comes from numeric fields.

 

Thanks,

 

Reda

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events