Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,739
Community Members
 
Community Events
176
Community Groups

api jira - custom field within "com.atlassian.jira.plugins.cmdb:cmdb-object-cftype"

Edited

Hi

I have this schema for a custom field

 

"customfield_10020": {
        "required": false,
         "schema": {
         "type": "array",
         "items": "cmdb-object-field",
          "custom": "com.atlassian.jira.plugins.cmdb:cmdb-object-cftype",
          "customId": 10020
},
"name": "Rotation",
"key": "customfield_10020",
"operations": [
     "set"
],
"configuration": {
      "multiple": true,
        "attributesIncludedInAutoCompleteSearch": [
         "Name"
],
"isInsightAvailable": true
}
},
1. What type of field is com.atlassian.jira.plugins.cmdb:cmdb-object-cftype
2. Which would it be the json to create an issue via api?. How can I post data to this field?
ie:
   "customfield_10020":
           .......¿?
}
Thanks

1 answer

0 votes

Strictly speaking, the field type is "com.atlassian.jira.plugins.cmdb:cmdb-object-cftype".  The class name is used as the unique field type descriptor in the code,

For this type though, I understand that it is "Insight" providing the field type.  There are some examples of using the field with the REST API at https://confluence.atlassian.com/insightapps/insight-with-jira-rest-api-1085180905.html

Thanks for the anwser. In that example:

{"key" : "TEST-1"}

Key is the "key" of the field customfields_100010 and "TEST-1" is the value of the field customfield_10010?

 "customfield_10100" : [{"key" : "TEST-1"}],
 "customfield_10200" : [{"key" : "TEST-1"}, {"key" : "TEST-2"}]

I gave a try  with json data when I've created and issue and doesn't add the value of the field "24Q" within the ticket.

 "customfield_10064" : [{"customfield_10064" : "24Q"}],

The "key" of the field "customfield_10064" is "customfield_10064". I have it from the endpoint:

https://mydomin.atlassian.net/rest/api/2/issue/TAPP-18/editmeta

What error do you get in the response?

I don't get error, but when I go to see the created ticket in jira, it doesn't show the value 24Q in that field.

I don't understand!, Can it be that the user must field this customfield_10064 manually?

This is my json:

{
      "fields": {
             "summary": "ticket from app",
             "issuetype": {
                  "id": "10005",
              },
             "customfield_10064" : [{"customfield_10064" : "24Q"}],
              "project": {
                    "key": "PJT"
               },
      }

}

 

And this the matadata of this field:


"customfield_10064": {
          "required": false,
            "schema": {
                   "type": "array",
                    "items": "cmdb-object-field",
                    "custom": "com.atlassian.jira.plugins.cmdb:cmdb-object-cftype",
                     "customId": 10064
              },
              "name": "Concession",
              "key": "customfield_10064",
              "autoCompleteUrl":                                  "https://mydomain.atlassian.net/rest/servicedesk/cmdb/1/field/customfield_10064/config/10167/autocomplete?",
              "operations": [
                     "set"
                ],
               "configuration": {
                      "multiple": true,
                       "attributesIncludedInAutoCompleteSearch": [
                                      "Name"
                          ],
                        "isInsightAvailable": true
                  }
},

Ok, so what do you get in response?

ok, 200. 

"{\"id\":\"25765\",\"key\":\"PJT-14810\",\"self\":\"https://mydomain.atlassian.net/rest/api/3/issue/25765\"}"

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events