Comments (14)
How does one find out what the custom fields should be?
from ejira.
I'm sorry for the documentation, it really is not comprehensive enough...
So, the intended way ejira is used is not to enable ejira-mode
manually. Instead, you configure your JIRA server as shown in the README (essential settings are jiralib2-url
, jiralib2-user-login-name
, ejira-projects
and ejira-main-project
).
Then you run the command M-x ejira-update-issues-in-active-sprint
. That will fetch tickets from all projects listed in ejira-projects
which are in the currently ongoing sprint (of project ejira-main-project
, JIRA can have tickets from multiple projects in a sprint that is tied to a single project). This command can then be run to sync the state from the JIRA server.
Then, there are multiple ways to interact with the tickets.
- through agenda view:
(org-add-agenda-custom-command ejira-sprint-agenda)
binds the ejira agenda to the 's' agenda key (M-x org-agenda s
). - through helm-ejira:
helm-ejira
for filtering through all tickets, orhelm-ejira-sprint
for filtering thtough only the tickets in the ongoing sprint. - you can also manually browse the org-file, most of the interaction commands (
ejira-update-current-issue
,ejira-add-comment
,ejira-assign-issue
,ejira-progress-current-issue
etc.) work from an org-mode buffer without havingejira-mode
active as long as point is somewhere inside the ticket you want to interact with. - 'M-x ejira-focus-on-clocked-issue
if
org-clock` is clocking an issue focuses on that issue.
The package does not have any default bindings yet, I use evil personally.
I do not expect everything to work out-of-the-box yet, since you are probably the first one after me who is taking the library to use. It has also never been tested with any other JIRA server, or any other workflow. But let's see if we can you up and running.
Feel free to send more comments if something does not work, something works weirdly or something is unclear.
from ejira.
When I execute M-x ejira-update-issues-in-active-sprint
I only get if: Wrong type argument: number-or-marker-p, nil
but i dont get in detail where the error occurs.
from ejira.
Can you enable debug-on-error M-x toggle-debug-on-error
, then run the command again and it should give you the stacktrace. I could then take a look at it.
from ejira.
the only part i understand is the 401 ^^ does it mean i have no access to the api?
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) =(nil 401) (if (= (progn (or (and (memq (type-of response) cl-struct-request-response-tags) t) (signal 'wrong-type-argument (list 'request-response response))) (aref response 1)) 401) (progn (message "Session expired, retrying...") (jiralib2-session-login) (setq response (jiralib2--session-call path args)))) (let ((response (jiralib2--session-call path args))) (if (= (progn (or (and (memq (type-of response) cl-struct-request-response-tags) t) (signal 'wrong-type-argument (list 'request-response response))) (aref response 1)) 401) (progn (message "Session expired, retrying...") (jiralib2-session-login) (setq response (jiralib2--session-call path args)))) (progn (or (and (memq (type-of response) cl-struct-request-response-tags) t) (signal 'wrong-type-argument (list 'request-response response))) (aref response 3))) jiralib2-session-call("/rest/api/2/search" :type "POST" :data "{\"jql\":\"project in (DRS) and sprint in openSprints()\",\"maxResults\":100}") (assoc 'issues (jiralib2-session-call "/rest/api/2/search" :type "POST" :data (json-encode (list (cons 'jql jql) (cons 'maxResults limit))))) (cdr (assoc 'issues (jiralib2-session-call "/rest/api/2/search" :type "POST" :data (json-encode (list (cons 'jql jql) (cons 'maxResults limit)))))) (append (cdr (assoc 'issues (jiralib2-session-call "/rest/api/2/search" :type "POST" :data (json-encode (list (cons 'jql jql) (cons 'maxResults limit)))))) nil) jiralib2-do-jql-search("project in (DRS) and sprint in openSprints()") (first (jiralib2-do-jql-search (concat "project in (" ejira-main-project ") and sprint in openSprints()"))) (ejira-extract-value (first (jiralib2-do-jql-search (concat "project in (" ejira-main-project ") and sprint in openSprints()"))) 'fields ejira-sprint-field) (mapcar (function ejira-parse-sprint) (ejira-extract-value (first (jiralib2-do-jql-search (concat "project in (" ejira-main-project ") and sprint in openSprints()"))) 'fields ejira-sprint-field)) (mapc (function (lambda (s) (if (equal (progn (or (and (memq (type-of s) cl-struct-jira-sprint-tags) t) (signal 'wrong-type-argument (list 'jira-sprint s))) (aref s 3)) "ACTIVE") (progn (throw 'active-sprint (progn (or (and (memq (type-of s) cl-struct-jira-sprint-tags) t) (signal 'wrong-type-argument (list 'jira-sprint s))) (aref s 2))))))) (mapcar (function ejira-parse-sprint) (ejira-extract-value (first (jiralib2-do-jql-search (concat "project in (" ejira-main-project ") and sprint in openSprints()"))) 'fields ejira-sprint-field))) (catch 'active-sprint (mapc (function (lambda (s) (if (equal (progn (or (and (memq (type-of s) cl-struct-jira-sprint-tags) t) (signal 'wrong-type-argument (list 'jira-sprint s))) (aref s 3)) "ACTIVE") (progn (throw 'active-sprint (progn (or (and (memq (type-of s) cl-struct-jira-sprint-tags) t) (signal 'wrong-type-argument (list 'jira-sprint s))) (aref s 2))))))) (mapcar (function ejira-parse-sprint) (ejira-extract-value (first (jiralib2-do-jql-search (concat "project in (" ejira-main-project ") and sprint in openSprints()"))) 'fields ejira-sprint-field)))) (setq *current-sprint* (catch 'active-sprint (mapc (function (lambda (s) (if (equal (progn (or (and (memq (type-of s) cl-struct-jira-sprint-tags) t) (signal 'wrong-type-argument (list 'jira-sprint s))) (aref s 3)) "ACTIVE") (progn (throw 'active-sprint (progn (or (and (memq (type-of s) cl-struct-jira-sprint-tags) t) (signal 'wrong-type-argument (list 'jira-sprint s))) (aref s 2))))))) (mapcar (function ejira-parse-sprint) (ejira-extract-value (first (jiralib2-do-jql-search (concat "project in (" ejira-main-project ") and sprint in openSprints()"))) 'fields ejira-sprint-field))))) ejira-update-current-sprint() ejira-update-issues-in-active-sprint() funcall-interactively(ejira-update-issues-in-active-sprint) call-interactively(ejira-update-issues-in-active-sprint record nil) command-execute(ejira-update-issues-in-active-sprint record) #f(compiled-function (cmd) #<bytecode 0x1c8dd01>)("ejira-update-issues-in-active-sprint")
i have no idea how to make this code look pretty, sorry
from ejira.
i have no idea how to make this code look pretty, sorry
No problem, I can manage with this one.
The issue seems to be that the HTTP response does not have a status code (it gets set to nil and thus the comparison to 401 fails). So the 401 here is not the actual status code you receive, but one we compare it to.
Maybe it times out? How long does it take for the command to fail?
Double check that jiralib2-url
is set correctly. You can also check with a browser whether you can access http[s]://your.jira.url.com/rest/auth/1/session
(first login to JIRA normally so that you get an active session cookie). You should receive json similar to this:
{
"self": "https://your.jira.url.com/rest/api/latest/user?username=myusername",
"name": "myusername",
"loginInfo": {
"failedLoginCount": 53,
"loginCount": 4903,
"lastFailedLoginTime": "2018-08-21T13:28:42.504+0300",
"previousLoginTime": "2018-09-18T17:37:19.320+0300"
}
}
If that does not work, your JIRA instance might have REST api disabled, ask your administrator.
Edit: FYI, I was able to reproduce the same error by making my jiralib2-url
invalid. I will add a proper error message there. Also, it most likely rules out timeout, so my advice would be to get the rest call working with browser, then setting jiralib2-url
based on that. In this example the value would be "https://your.jira.url.com"
.
from ejira.
hmm ... strange ...
I login in my browser to jira and go to https://jiraurl.com/rest/auth/1/session
and i get
{
"self":"https://jiraurl.com/rest/api/latest/user?username=demo",
"name":"demo",
"loginInfo":{
"failedLoginCount":11,
"loginCount":216,
"lastFailedLoginTime":"2018-08-08T10:37:21.984+0200",
"previousLoginTime":"2018-09-19T08:54:54.522+0200"
}
}
but in my init.el jiralib2-url
is set to https://jiraurl.com
and jirallib2-user-login-name
is demo
(emacs asks me for the password when prompting (demo)
so i think it is correctly set. Does it help if I try the REST requests via an external tool (i have Postman) and look at the responses? Which requests are done in ejira-update-issues-in-active-sprint
?
from ejira.
The password is asked before the actual request is made so it is not a quarantee that the login was successful.
Easy way to check if the login works is to evaluate (jiralib2-session-login "demo" "demo's password")
. That should save a session token in *JIRA-SESSION*
-global variable. It's value is JSESSIONID=<the session cookie>
after a successful login.
ejira-update-issues-in-active-sprint
first does a login call if no session variable is found, then it fetches the active sprint information by doing a POST request to /rest/api/2/search
with the data:
{
"jql": "project in (<ejira-main-project>) and sprint in openSprints()",
"maxResults": 100
}
Parentesis around the <ejira-main-project>
are required, as it is a list.
If an active sprint is found and it is successfully parsed, then it tries to fetch the actual issue data.
You can also pull the newest changes I made yesterday, it should give a bit better error messages for failed API calls.
from ejira.
Well *JIRA-SESSION*
seems to be set to "JSESSIONID=46C...."
so this part is fine.
from ejira.
You can then try the /rest/api/2/search
with Postman.
The request is POST
and the headers you need are:
Content-Type: application/json
cookie: JSESSIONID=46C...
The cookie expires in a short while, so you most likely need to renew it by calling jiralib2-session-login
again.
You can try with several search queries: {"jql": "project in (DRS)", "maxResults": 30}
should just give you 30 tickets in the given project. Then, you can try adding the and sprint in openSprints()
-clause to see if that is the reason for the error.
from ejira.
Hi,
Also trying to get this working.
I'm stucked with the installation. Followed the readme, however seems that the package cannot be loaded.
Simply cloned the repo and tried to initialize with the use-package
(use-package ejira :load-path "~/.emacs.d/local-pkg/ejira" :ensure nil)
And I'm getting the following error:
Error (use-package): ejira/:catch: Cannot open load file: No such file or directory, language-detection
from ejira.
language-detection.el is required by ejira. You can install it from melpa. Other dependencies are ox-jira, s, cl-lib and request.
from ejira.
Already solved. Was a bug on my configuration!
Great work.
from ejira.
The way I did it was to pull the json of one of the tickets from the rest api with Postman and then manually check what is the name of the field containing the desired information, for example the epic key.
I don't know if there is a way to extract this mapping directly from the API.
from ejira.
Related Issues (20)
- ejira-progress-issue fields for code review
- verbatim text (curly braces) HOT 4
- Having trouble logging in HOT 1
- ejira does not appear to be published anywhere HOT 3
- Working on issues with multiple users HOT 4
- ejira-hourlog seems to be one hour off for every entry HOT 10
- I can unassign an issue but I can't assign it to a user or myself HOT 14
- wrong-type-argument stringp replace-regexp-in-string (at ejira--parse-sprint) HOT 20
- Feature: add "open in external browser" method HOT 4
- Issues moved between projects show up in both projects
- `Update-my-projects` doesn't get all issues for very large projects
- ejira-update-my-projects not working HOT 1
- update-my-projects fails on first run HOT 2
- ejira-heading-to-task return errors HOT 1
- Add {noformat} to parser HOT 2
- Team-managed projects lack Epic Links etc
- How to use with Jira cloud HOT 4
- `ejira-update-my-projects` should be asynchronous HOT 1
- Does ejira has plan to host on melpa?
- (invalid-function #<buffer AAA.org>) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ejira.