Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Bar duration in roadmap-planner storage format

Dear all,


I'd like to automatically update roadmap-planner macros via the REST API. However, it seems that the choice of representation is a bit roundabout:

// ...
lanes: [
title: 'Some Lane',
color: { bar: 'red', count: 1, lane: 'blue', text: 'black' },
bars: [
title: 'Some Bar',
description: '',
startDate: '2017-01-01T00:00:00.000Z',
duration: 3.456, // <========= PROBLEM
rowIndex: 0,
id: '57ab0b36-7ba5-4f89-957b-d83bd5ff7e3f'
// ...
// ...
// ...

The problem for me with this format is that the duration needs to be specified either as a fraction of weeks or months, depending on the roadmap display option.

However, if selecting months, given a start and end date, it seems to be quite non-trivial to compute the months fraction, since not all months are equal length. If I understand the plugin source code it looks like this calculation is based on the milliseconds in a month.

So, here the questions:

  • Anybody got experience automatically updating the roadmap? How do you handle the duration?
  • Isn't this model overcomplicating things? Wouldn't it be much more natural to specify an end-date? Would such a feature-request in the issue tracker have a chance?

1 comment

Besides my questions which I still hold up, here is a function which seems to accurately compute the months duration as expected by Confluence with the help of moment.js:

function countMonths(start, end)
  var s = moment(start);
  var e = moment(end);

  var sbom = moment(start).startOf('month');
  var seom = moment(start).endOf('month');

  var ebom = moment(end).startOf('month');
  var eeom = moment(end).endOf('month');

  var count = Math.round(ebom.diff(seom, 'months', true)) + 1;
  count += seom.diff(s) / seom.diff(sbom);
  count += e.diff(eeom) / eeom.diff(ebom);
  return count;


Log in or Sign up to comment
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

848 views 10 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you