Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Syncing a system field to a custom field; It is not on the appropriate screen, or unknown error

 
1
0
-1

When I attempt to Sync the Status field of one project to a custom field "Engineering" in another (via Jira Cloud, same Jira instance), I get the following error: 

Field Field 'customfield_10181' cannot be set. It is not on the appropriate screen, or unknown.: customfield_10181.


I have verified that the Engineering Status field is on the screen used in the project I'm sending the value to. 


Here is my script:

Outgoing:

replica.status = issue.status

Incoming:

issue.customFields."Engineering Status".value = replica.status.name




    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Issue has been resolved by adding the issuetype condition. Error happened as earlier code trying to update this field for ServiceRequest Type. After giving condition of applicable issue type in the connection script issue is resolved and sync of SR tickets working.


      if((issue.customFields."10328"!=null) && (issue.type=="Incident")){
      issue.customFields."10328".value = replica.customFields."10500"?.value ?: "None"
      }

        CommentAdd your comment...
      1.  
        1
        0
        -1

        There might be other reasons why setting the custom field is failing

        Check following page for more info
        https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/


        Can you get the output of following rest call where you change the <issuekey> placeholder with the key of the issue where you want to update the field, and the host with the appropriate host

        https://<your atlassian.net host>/rest/api/3/issue/{issueIdOrKey}/editmeta


        Check the output - is the customfield listed?



        Another way is to set the customfield by hand on the issue, and then get that value with

        https://<your atlassian.net host>/rest/api/3/issue/{issueIdOrKey}

        It should be there

        1. Destri Weir

          Francis Martens (Exalate) Thank you so much for your response. When I try the editmeta rest call, it just returns 

          {"fields":{}}.

          When I set the custom field by hand, I do data returned, but I'm not sure what to with it.
          Here are the snippets that list my custom field 10182:

          {"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_10169.properties,customfield_10010.requestTypePractice","id":"10182","self":"https://wenergysoftware.atlassian.net/rest/api/3/issue/10182","key":"LDP-60","fields":{"statuscategorychangedate":"2021-08-18T16:32:00.519-0500","parent":{"id":"10146","key":"LDP-49","self":"https://wenergysoftware.atlassian.net/rest/api/3/issue/10146","fields":{"summary":"Populate Knowledge Base with Docs","status":

          {"self":"https://wenergysoftware.atlassian.net/rest/api/3/resolution/10000","id":"10000","description":"Work has been completed on this issue.","name":"Done"},"customfield_10113":null,"customfield_10114":null,"customfield_10107":null,"lastViewed":null,"customfield_10060":null,"customfield_10061":null,"customfield_10182":null,"customfield_10062":null,"customfield_10183":null,"customfield_10063":null,"customfield_10064":null,"customfield_10065":null,"customfield_10100":null,"priority":


          {}","customfield_10001":null,"customfield_10089":null,"customfield_10122":null,"customfield_10002":null,"customfield_10003":null,"customfield_10004":null,"customfield_10125":null,"customfield_10115":null,"customfield_10116":null,"customfield_10117":null,"environment":null,"customfield_10119":null,"duedate":null,"comment":{"comments":[],"self":"https://wenergysoftware.atlassian.net/rest/api/3/issue/10182/comment","maxResults":0,"total":0,"startAt":0}}}


          Other things to note: I have another field that is doing the same thing, but it is also mapping the status of one project to a custom column in another. It appears that trying to map this visually works the first time, but then fails, but I can't use visual mapping because I have other complicated mapping. 


          I'm not fluent in JSON, but the response I received doesn't seem as helpful as the responses in the examples provided at the link you references. I don't see my available values, for one. 


          The reason I need this to update is because we currently create linked stories via automation in separate projects and those links have the status easily available on the ticket. This isn't the case with Exalate. With Exalate, you have to actually go to the side panel and open the link to see the status in another project. That won't work for us. 

        2. Francis Martens (Exalate)

          No idea why editmeta is not returning any data ...

          Regarding the second call - Did you do the rest call after setting the field?
          Because it is not in the output - check it out.


          What is the type of that field?

        3. Destri Weir

          I now have a return on the edit meta (totally user error before):

          customfield_10182":{"required":false,"schema":{"type":"option","custom":"com.atlassian.jira.plugin.system.customfieldtypes:select","customId":10182},"name":"Linked Engineering Status","key":"customfield_10182","operations":["set"],"allowedValues":[{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10660","value":"To Do","id":"10660"},

          And the following for the field with the manual set:
          "customfield_10182":{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10661","value":"In Progress","id":"10661"},
        4. Destri Weir

          Actually the full text from Edit Meta is: 

          "name":"Linked Engineering Status","key":"customfield_10182","operations":["set"],"allowedValues":[{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10660","value":"To Do","id":"10660"},{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10661","value":"In Progress","id":"10661"},{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10662","value":"In Review","id":"10662"},{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10663","value":"Done","id":"10663"}]},

          So, it looks like it should be able to be set to the options that are available in the status list of the linked project.
        5. Francis Martens (Exalate)

          Ah - it is a dropdown field.

          Can you try to set it to an option that is available.

        6. Destri Weir

          I just added a default of one of the available options in project B to the column, and it's finally working.


          I owe you a drink, but I hope you'll settle for a few points and upvotes or whatever I'm limited to here. 

        7. Destri Weir

          Francis Martens (Exalate) Would you believe that it worked and synced once, and now I'm getting the same error again. 

          Error is: Jira Cloud error
          Field Field 'customfield_10182' cannot be set. It is not on the appropriate screen, or unknown.: customfield_10182.


          Here is the create meta for the failed attempt with the column populated with the default:

          "customfield_10182":{"required":false,"schema":{"type":"option","custom":"com.atlassian.jira.plugin.system.customfieldtypes:select","customId":10182},"name":"Linked Engineering Status","key":"customfield_10182","operations":["set"],"allowedValues":[{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10660","value":"To Do","id":"10660"},{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10661","value":"In Progress","id":"10661"},{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10662","value":"In Review","id":"10662"},{"self":"https://wenergysoftware.atlassian.net/rest/api/3/customFieldOption/10663","value":"Done","id":"10663"}]},"customfield_10183":{"required":false,"schema":


          I can write to any sort of field type. I switched it to a ddl because I thought that it might not be working because I was sending a ddl to a text field before. 


          Here is the script again:

          Outgoing: 

          replica.status = issue.status

          Incoming:

          issue.customFields. "Linked Engineering Status"?.value = replica.status?.name

        8. Destri Weir

          It looks like if I comment out that line in the sync and the sync runs successfully and then I uncomment the line, it updates as expected. Any idea what could be causing this?

        9. Destri Weir

          Essentially, I want to Exalate to create a ticket in our engineering project when the status of the Support story changes to Code Change, which it does. I then want the system Status column on the engineering ticket to update a custom "Linked Engineering Status" column on the Support ticket, so that Support is aware of the status of the ticket in Engineering without having to actually go to the side panel and open the ticket and see the status. I don't care how I achieve this but I do prefer to do it though a column that is reportable. 


          I can't figure out why it works once the column has had a value entered, but this isn't a column where a value would normally be set by Support. 

        10. Pranith Gidijala

          Hi Destri Weir , I am just wondering if you got any solution. I am also facing same error for Jira sync. However, i am still unable to find any solution for this.

        11. Ariel Aguilar

          Hi @Pranith,

          You may see more information here:

          https://docs.idalko.com/exalate/x/JYEAAg

          Then, it is important that if this is a required field for ticket creation, to add proper sync rules.

          Kind regards,

          Ariel

        12. Ariel Aguilar

          In addition, you may want to check the Proxy user permissions detailed here:

          https://docs.idalko.com/exalate/x/Rwp1Aw

        13. Pranith Gidijala

          Hi Ariel Aguilar , I tried both options and still getting same error

        14. Ariel Aguilar

          What type of field is this? Can you share the incoming script from Jira Cloud.

        15. Pranith Gidijala

          This is multi select field


          services.jcloud.exception.UpdateIssueJiraCloudException: Could not update issue `XXX-4321` with id `89359`: Field customfield_10232: Field 'customfield_10232' cannot be set. It is not on the appropriate screen, or unknown.. at services.node.JCloudTrackerExceptionCategoryService.generateUpdateIssueJiraCloudTrackerException(JCloudTrackerExceptionCategoryService.scala:421) at


          Below is script


          if(firstSync){
             issue.projectKey   = "BDL" 
             // Set type name from source issue, if not found set a default
             issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
          }
          issue.summary      = replica.summary
          issue.description  = replica.description
          issue.comments     = commentHelper.mergeComments(issue, replica)
          issue.attachments  = attachmentHelper.mergeAttachments(issue, replica)
          issue.labels       = replica.labels
          issue.status  = replica.status


          Tried additional below lines ,however it did not resolve the issue.



          if(issue.customFields."10232" != null){
          issue.customFields."10232".value = replica.customFields."10500"?.value ?: "None"
          }

          if(issue.customFields."customfield_10232" != null){
          issue.customFields."customfield_10232".value = replica.customFields."10500"?.value ?: "None"
          }

        16. Ariel Aguilar

          When you say multi select field, I will understand that is a select list multiple choices? Can you clarify by checking:

          https://support.atlassian.com/jira-cloud-administration/docs/custom-fields-types-in-company-managed-projects/


        CommentAdd your comment...