Copy tre-customfield value when clone a issue

Issue #67 closed
Former user created an issue

Hi. I have an application to clone a issue, but the valuer of my tree-customfield doesn't copy. How can I do that? thanks

Comments (16)

  1. Lucas Galan Valderrama

    The field is

    I’ve wrote

    { "update": {
    "Zona Afectada":[
    {
    "set": {"Id": { {issue.customfield_11209.id}}
    }
    } ]
    }}

    but it dowsn’t work

  2. Yury Oboz repo owner
    • "set": {"Id": { {issue.customfield_11209.id}} - use “id” instead “Id”
    • remove the extra space between brace: "set": {"id": {{issue.customfield_11209.id}}
    • still need to add quotes for “id“ value

    it should look like this

    { "update": {
      "customfield_11209":[{
        "set": {
          "id": "{{issue.customfield_11209.id}}"
        }
      }]
    }}
    

    Your tree customfield has a single or multiple choice?

  3. Lucas Galan Valderrama

    hi

    { "update": {
    "Zona Afectada":[
    {
    "set": {"id":{ {issue.customfield_11209.id}}
    }
    } ]
    }}

    the same result

  4. Yury Oboz repo owner

    For multiselect field try this:

    { "update": {
      "customfield_11209":[{
        "set": {{issue.customfield_11209.asJsonObjectArray("id")}}
      }]
    }}
    

  5. Lucas Galan Valderrama

    sorry. There are a problem. when the field is empty then system return Not Valid Json

  6. Yury Oboz repo owner

    Try this:

    {
      "fields": {
        "customfield_11209": [{{#issue.customfield_11209}} {"id": "{{id}}"} {{^last}},{{/}}{{/}}]
      }
    }
    

  7. Lucas Galan Valderrama

    Sorry, I have to put both ?

    { "update": {
      "customfield_11209":[{
        "set": {{issue.customfield_11209.asJsonObjectArray("id")}}
        "fields": {
        "customfield_11209": [{{#issue.customfield_11209}} {"id": "{{id}}"} {{^last}},{{/}}{{/}}]
      }
      }]
    }}
    

  8. Log in to comment