Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Custom Fields Not Synced #11

Closed
AshtonKem opened this Issue · 5 comments

3 participants

Ashton Kemerling Bao Haojun Christian Köstlin
Ashton Kemerling

My work uses two custom fields, "Story Points" and "Points Left" on issues to indicate the estimated work time, and the time left. These don't seem to be synced by org-jira.

Bao Haojun
Owner

Sorry for the late reply.

My site is not using custom fields, so I'm not sure if I can work on this feature for the moment. I would have to setup a Jira server myself.

Ashton Kemerling

I understand. It's not a huge deal, just a niceity.

Christian Köstlin

@baohaojun could you give a hint on how to hack one additional custom jira attribute? i really would like to add this feature at least to my private org jira. would be awesome if this could be a custom variable that could also be configured with dir locals.

Bao Haojun
Owner

I checked the jira soap api doc, the custom fields support in the api is very weak, it only supports getting the list of custom fields. It returns the ids and names of available custom fields. But to use custom fields, you will also need what values are legit for each custom field. For e.g., you should set up a mapping yourself that '(my-custom-field1 ["my-value1" "my-value2" ...]) is legal.

Then, when you update the issue, you can try to add your custom field. Search for jiralib-update-issue in org-jira.el, it is used only once in org-jira-update-issue-details:

      (jiralib-update-issue issue-id ;(jiralib-update-issue "FB-1" '((components . ["10001" "10000"])))
                            (list (cons
                                   'components
                                   (apply 'vector
                                          (mapcan
                                           (lambda (item)
                                             (let ((comp-id (car (rassoc item project-components))))
                                               (if comp-id
                                                   (list comp-id)
                                                 nil)))
                                           (split-string org-issue-components ",\\s *"))))
                                  (cons 'priority (car (rassoc org-issue-priority (jiralib-get-prioritys))))
                                  (cons 'description org-issue-description)
                                  (cons 'assignee org-issue-assignee)
                                  (cons 'summary (org-jira-get-issue-val-from-org 'summary))))

And you can insert a line after for e.g., (cons 'assignee org-issuer-assignee) like this:

(cons 'my-custom-field1 "my-custom-value1")

I'm afraid this will be a little messy, and not sure if it works. Patches are welcome if you can get it working, thanks.

Bao Haojun baohaojun closed this
Christian Köstlin

thanks for this comment. if i find the time i will try to implement this in a generic way. we use only 'untyped' strings as custom fields, so legal values is not an issue for me.
it looks this only copies the custom fields from org back to jira, do you have a pointer where the reverse direction is done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.