Setting request type in incoming script results in a jira error even if mandatory field has value

Originally asked by Asle Kristian Andersen on 30 October 2020 (original question)


Jira Service Desk Cloud:

I have some issues with setting the request type in the incoming script when components is a required field in the request type portal schema.

issue.customFields."Request Type".value =  "Feil på utstyr i transportmiddel" 

The incoming issue has components in the payload and this is the code I have to deal with components:

issue.components   = replica.components.collect
{
    component -> nodeHelper.createComponent(
        issue,
        component.name,
        component.description,
        null,
        "PROJECT_DEFAULT"
    )
}

If the component field is not mandatory in the request type, it works fine. Components are created if not found and if found used on the issue.

The error is thrown from Jira itself since the error message is in Norwegian :smile: and is of type: Blocked, cant create issue because no value found in a mandatory field. However as stated, the replica issue has components.

Also, if I ‘comment out’ the request type line in the script, the issue is created and the components attached. I can then manually set the request type in the issue.

I would like the issue to be ready formated as the request type as if the issue was creaded in the portal


Answer by Francis Martens (Exalate) on 04 November 2020

Can you check that issue.components has components set using

throw new Exception("The components are ${issue.components.properties}")

This will throw an error and provide you a hint if components have been set.


Comments:

Asle Kristian Andersen commented on 04 November 2020

This is the error caught.

Francis Martens (Exalate) commented on 05 November 2020

Thats indeed the exception to be expected.

Can you further check if the first element is set correctly and continue to poke around until you find the root cause.

Asle Kristian Andersen commented on 12 November 2020

It seems the only reason the error happens is, if components is a mandatory field on the Request Type. I have changed it back and forth and have additional text fields as mandatory whithout it throwing an error. Only when components is set as mandatory is the issue stopped in the sync.

Is this something you can replicate in your test systems?

Juan Grases commented on 12 November 2020

Hi!

Actually this is a missing feature on Jira Cloud but we have already a fix for it, it will be released soon. For now, Could you provide to us your Jira Cloud URL, so I can deploy this fix to you?

Best regards,

Juan

Asle Kristian Andersen commented on 12 November 2020

Hi Juan.

Our Cloud URLs are:

https://skyssdigital.atlassian.net/ (Prod)

https://skyssdigitaltest.atlassian.net/ (Dev/Test)

Remote Cloud URLs:

https://tidebuss.atlassian.net (Prod)

https://tidebuss--test.atlassian.net (Dev/Test)

Juan Grases commented on 12 November 2020

I have upgraded your instances, could you check if you still have the same problem?

Asle Kristian Andersen commented on 13 November 2020

Initial testing seems that the update was a success.

We will make changes to all instances and connections where this is used.