Hello, dear habrazhiteli! Today we would like to talk about the calendar that we use in JIRA. Not so long ago we updated it, and since there was never an article about it, we decided to write about it as a whole, and not just about the changes. Details under the cut.
What did you want?
- Viewers of our issues that can be selected either by project or by filter
- Convenient interface
- The ability to set as a starting and ending date for issuing not only standard fields, such as Due Date or created, but any Custom Field
- Ability to scroll calendars for groups and project roles
Plus, I would like to add new features as needed, and all more or less suitable solutions were closed source.
What did you get?
On the calendar page you will see 2 blocks, not counting the header. In the left - the events in the right - the calendars themselves. Calendars are divided into 3 groups: My calendars, Shared calendars and the Rest. The last group is visible only to JIRA administrators. The first group speaks for itself, the second includes calendars shared by you, either through the group or through the project role. In the third group, administrators see all calendars that are not included in the first 2 groups. Administrators are free to do almost everything with all calendars: delete, edit any field, change groups and project roles for balls.
')
The create / edit window is a simple set of fields, obvious for creating a calendar. Only the name, source of requests and the start of the event are mandatory. Here you can share the calendar for any group or project role available to you. In the right pane, you can also control the visibility of the calendars shared on you. By default, the calendar shared on you will first be displayed as hidden. You can change this by clicking on it. A colored square means a visible calendar, a colored frame is invisible.
In the left pane are the events themselves. As a basis for drawing the issues, we decided to use the jQuery plugin
Full Calendar . In the event itself, we only see the issue summary, but if you click on each, then the information on the issue will open in a separate popup, with the possibility of a transition to this issue.
There are fields that appear in this popup by default: artist, author, and description issue. The rest of the fields you, as the author of the calendar, you can customize in the "Fields" field of the create / edit calendar. Events can be moved and stretched if you have the right to change the corresponding issue in JIRA, and the “Start of event” and “End of event” fields are not set to values ​​such as “Created”, “Updated” and “Resolved”, which corresponds to the date of creation, the date of the last editing and the date of the decision issue, respectively.
Technical part
On the frontend, we used one of the latest AUIs, which we talked about in one of the
previous posts . On the one hand, it is quite convenient to use all the newest components from the AUI library, on the other hand, it is rather troublesome to ensure good backward compatibility. Let's say Inline Dialog 2 appeared not so long ago and is not available in versions of JIRA earlier than 6.2. FullCalendar is used to draw the issue itself. On the backend-e JIRA API + data storage in Active Objects. JIRA API allows us to build jql based on events, start and end of events, check access to issues, etc. Active Objects allows you to conveniently store data both about the calendars themselves and about the user's preferences, such as which of the shared calendars should be hidden and which should be visible. For a long time, we retrieved and stored this information using the PluginSetting class, first serializing it into XML. At the last calendar change, we decided to use Active Objects. First, there is no need for serialization, and secondly, it is easier to work with Active Objects.
Conclusion
We expect to further refine this plugin. In particular, we want to add the ability to view any custom field in the popup event. Source code can be viewed on github. An updated calendar is available for JIRA 6.3+.
Link to github -
github.com/mailru/jira-plugins-mailrucal
Link to marketplace -
marketplace.atlassian.com/plugins/en.mail.jira.plugins.mailrucal