Jira Issue Properties

871 views
Skip to first unread message

ga...@saucelabs.com

unread,
Mar 28, 2016, 8:17:12 PM3/28/16
to Atlassian Connect Dev
Hi

I'm trying to add properties to an issue and do a JQL to look them up again later.

Following https://developer.atlassian.com/jiradev/jira-platform/building-jira-add-ons/jira-entity-properties-overview tutorial, I'm successfully able to add properties using both POSTing a new issue, and PUT an update an issue after the fact.

I feel like I'm missing something very obvious.

I've added a section to my descriptor to index it but no matter how I try and search no results come back:

curl -u admin:admin -X PUT -H "Content-type: application/json" http://localhost:2990/jira/rest/api/2/issue/TEST-9/properties/sauce -d '{"id":"71bd8ffae68a4349b8965681a1d9659f"}' -v
curl -u admin:admin -X PUT -H "Content-type: application/json" http://localhost:2990/jira/rest/api/2/issue/TEST-9/properties/sauce-entity-job-id -d '{"id":"71bd8ffae68a4349b8965681a1d9659f"}' -v




Descriptor:

{
"baseUrl": "http://localhost:3030",
"key": "sauce-jira-integration-dev",
"authentication": {
"type": "jwt"
},
"vendor": {
"name": "Sauce Labs",
},
"description": "Saucelabs plugin for jira",
"name": "Saucelabs jira plugin",
"lifecycle": {
"installed": "/installed",
"uninstalled": "/uninstalled",
"enabled": "/enabled",
"disabled": "/disabled"
},
"scopes": ["READ", "WRITE"],
"modules": {
"configurePage": {
"url": "/configure",
"key": "my-config-page",
"name": {
"value": "My Configure Page"
}
}
},
"jiraEntityProperties": [{
"name": {
"value": "Sauce index",
"i18n": "sauce.index"
},
"key": "sauce-entity-job-id",
"entityType": "issue",
"keyConfigurations": [{
"propertyKey": "sauce",
"extractions": [{
"objectName": "sauce.id",
"type": "string"
}]
}]
}]
}


Robert Massaioli

unread,
Mar 28, 2016, 8:20:05 PM3/28/16
to Atlassian Connect Dev
With a cursory inspection it seem that the problem is the 'objectName' in the 'extractions'. You want 'objectName': 'id' because you have already specified 'sauce' via the 'propertyKey'.

Do something like this:

"keyConfigurations": [{
"propertyKey": "sauce",
"extractions": [{
"objectName": "id",
"type": "string"
}]
}]

That should work.

ga...@saucelabs.com

unread,
Mar 28, 2016, 8:31:38 PM3/28/16
to Atlassian Connect Dev
Pretty sure I tried that as well but i'll give it another go when i have a minute.

The atlassian validator warned me that jiraEntityProperties wasn't valid so i was wondering if I had that wrong

additionalProperty "jiraEntityProperties" exists in instance when not allowed

Robert Massaioli

unread,
Mar 28, 2016, 8:37:30 PM3/28/16
to Atlassian Connect Dev
Ah, that is also correct, the 'jiraEntityProperties' section is an Atlassian Connect module. You need to move that inside the 'modules' section.

I modified your descriptor for you. Try this instead: https://bitbucket.org/snippets/robertmassaioli/LRyxe

Gavin Mogan

unread,
Mar 31, 2016, 1:33:57 PM3/31/16
to Atlassian Connect Dev
Thanks, that totally fixed it.

--
You received this message because you are subscribed to a topic in the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/atlassian-connect-dev/T4lbKYbuNHw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Gavin Mogan
Software Developer

Sauce Labs | Sauce blog

Talk to us anytime:    

Reply all
Reply to author
Forward
0 new messages