Search code examples
gmailjirajira-plugin

using mail server to communicate with jira using api


im new to jira and its mail handlers.i want to use the jira's mail handlers to scan two folders in my mail box.and update two projects related to those folders. and i did that.

but now i want to extend that functionality.i want to keep the mails in those folders (stop mail handlers from deleting it after processing) and make it able to move issues/tasks across projects simply by moving the associated mail from the folder to the other folder. resulting in deletion of the original issue/task from that project and creating it in the other folder. please help in making this a possibility.

for those who didnt understand my problem: imagine im sending a cv for the post of php developer to a mail. when the reciepent checks it, he puts it in the php folder in his mailbox.so then a task is created in the project php developers. but next the reciepents thinks im more suitable in web developement rather than in php. so he just moves the mail from php folder to the web folder.so the existing task in php project gets deleted and a new task is created under web developement project. can i do this? if so how? please guide me..

Update

sigh.. i dont know how to work with corporate people. now the situation has changed. i hope you could help me with this one.sorry about the sudden change in the question..again... now my boss wants sth like this.

i created a mail client using imap function to access mail services and retrieve those mails to a web function. theres no problem in that. but now my boss wants to handle jira through that same app aswell. means as like the my question when moving, putting a mail to a folder the app it self should comunicate with jira and make the necesary issue creation and deletion.. is this possible @Kuf?? if so please help. because my deadline is due Wednesday. and im almost there to panic..lol..please forgive me for changing questions like this. as it is not my will..

edit

I have seen that rest api does this. but how to use it? any answers?


Solution

  • The simplest way I found was to receive the emails in your main account and forward them to a second account, while saving a copy on the mail server. Than, tell Jira to pull the emails from the second email.

    UPDATE

    In the past, I've looked for a way to change Jira's email handler functionality, as you can see in this question here. It is impossible to achieve what you're asking using Jira's email handler because the way it works, it does not keep records of which emails were already read, Jira's service checks for new emails, ignores emails according the pre-defined filters (spam or user defined), handles the rest of the emails, and deletes them so it won't process them again.

    The way I can think of to get the functionality you want is to re-write the email handler, you can get the source code, re-write it, and build it into your Jira app.

    Another way, which i find easier, is to get all the emails into Jira, and from within Jira move the issues from one project to another. You can even create pre-defined buttons using Jira Scripting Suite to easily move issues between projects (create a post function and attach it to workflow transition).

    If you need any help let me know. Good luck!

    EDIT 2

    Which Jira version do you use? which actions are you planning to do using the remote API? Jira REST API is the newest, but some of the old APIs have capabilities that are lacking in REST. To try and decide which API suits you, have a a look at JIRA Remote API Reference.

    If you decide to use the REST API, I suggest that you read Jira's Getting Started with REST manual, which shows how to use the REST API. For the full documentation check out JIRA REST API documentation (make sure to use the right version according to your Jira version).