Hello all,
We have Jira Core and We would like to synch jira tasks due dates with CALDAV server.
Is that possible?
Thank you
any suggestions?
Hi!
it is possible.
1. You can write a service which will sync due dates, e.g. you can use the python scripts
https://github.com/AstroMatt/atlassian-python-api
2. Otherwise you can write script in Jira using groovy, e.g. Scriptrunner, groovioly, amigo ...
3. Also, you can write own plugin for Jira.
4. Or you can write something on Caldav side.
Cheers,
Gonchik Tsymzhitov
Indeed I've made Python script to synch due dates (it's still not finished because if I delete some key in Jira doesn't delete it on Calendar).
I copy it below, feel free to improve it and share it back.
import caldavfrom caldav.elements import dav, cdavfrom icalendar import Calendar, Eventfrom datetime import datetime from icalendar import LocalTimezonefrom jira import JIRAimport reimport pytzurl = "https://user:pass@domain.com/remote.php/dav/calendars/jira/"client = caldav.DAVClient(url)principal = client.principal()calendars = principal.calendars()if len(calendars) > 0: calendar = calendars[1] options = { 'server': 'http://xxx.xxx.xxx.xxxx:8080'} jira = JIRA(options,basic_auth=('user', 'pass')) for i in jira.search_issues('filter=10502',maxResults=1000): cal = Calendar() cal.add('prodid', '-//JiraCalDavSynch//') cal.add('version', '2.0') start_date_ok = True end_date_ok = True if str(i.fields.customfield_10301) != 'None': event_start = datetime.strptime(str(i.fields.customfield_10301), "%Y-%m-%d") else: start_date_ok = False if str(i.fields.duedate) != 'None': event_end = datetime.strptime(str(i.fields.duedate), "%Y-%m-%d") else: end_date_ok = False event_created = datetime.strptime(str(i.fields.created)[0:10], '%Y-%m-%d') if((not start_date_ok) and end_date_ok): event_start = event_end elif(start_date_ok and (not end_date_ok)): event_end = event_start if(start_date_ok or end_date_ok): event = Event() event.add('summary',i.key+': '+i.fields.summary) event.add('dtstart', event_start ) event.add('dtend', event_end) event.add('dtstamp', event_created) event.add('uid',i.key) cal.add_component(event) event = calendar.add_event(cal.to_ical())
It looks like you're new here. Sign in or register to get started.