vipsoft / JiraExtension

Load Features for Behat from Jira issues
MIT License
22 stars 18 forks source link

Support Jira 5 REST API to autotag custom fields #3

Open robocoder opened 12 years ago

robocoder commented 12 years ago

In Jira 4.4, the SOAP API doesn't give non-administrator access to the CustomField "name" property (a human-readable string). For example, what is "customfield_10180"?

object(stdClass)#3 (21) {
...
  ["customFieldValues"]=>
  array(5) {
    [0]=>
    object(stdClass)#4 (3) {
      ["customfieldId"]=>
      string(17) "customfield_10180"
      ["key"]=>
      NULL
      ["values"]=>
      array(1) {
        [0]=>
        string(5) "43947"
      }
    }

The REST API tells us this is the global "Rank".

object(stdClass)#1 (5) {
...
  ["fields"]=>
  object(stdClass)#2 (39) {
    ["customfield_10180"]=>
    object(stdClass)#7 (3) {
      ["name"]=>
      string(4) "Rank"
      ["type"]=>
      string(41) "com.pyxis.greenhopper.jira:gh-global-rank"
      ["value"]=>
      int(43947)
    }

Jira 4.4 has 2.0.alpha1 of the REST API, but it doesn't support posting comments.

robocoder commented 12 years ago

Proposed config:

    custom_fields:
        custom_field_name: name_of_property
       ...

Example:

    custom_fields:
        # assumes 'value' is a simple property (e.g., string or int)
        Rank: ~
        # assumes 'value' is an array of objects
        Watchers: name
robocoder commented 10 years ago

Time flies...Jira 6.1.5 was released. REST has been deprecated, and Atlassian plans to remove SOAP/RPC in Jira 7.