Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

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;
}

Comment

Log in or Sign up to comment
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

462 views 24 9
Join discussion

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