I'm currently seeking help in a challenging task (at least for me) ;)
We have a Confluence space, that gets copied every year and where the copied space is then modified. These particular spaces also have the current year in its space keys, i.e. "wbk2022" for the new one, the one from last year would be "wbk2021". All pages in these spaces also include a user macro, that grab all relevant Jira issues, which relate to that space and where created that particular year.
Here's an example:
<ac:parameter ac:name="jqlQuery">project = WEITERBILD and "Titel des Training" ~ "$content.title" AND created >= 2021-01-01 AND created <= 2021-12-31</ac:parameter>
What we have to do every year, is copy that space with all its pages, create a copy of last years user macro and alter the date in that query. This is needed, because the "old" spaces need to be archived along with all referenced Jira issues of the corresponding year.
What I am trying right now is to extract the year from space key and use that information in my JQL query, therefore we would not need to create another user macro every year or alter all pages in the newly copied spaces.
I hope I was clear enough about my idea. Any help is highly appreciated ;)
Thanks and best regards
Thanks for your suggestion, I got it to work as I wanted in the first place, I just had a typo in my code... :(
I finally managed to extract the year from space key with a split() function, set my date range variables for the following JQL query and used these in my JQL:
<ac:parameter ac:name="jqlQuery">project = WEITERBILD and "Titel des Training" ~ "$content.title" AND created >= $start AND created <= $end</ac:parameter>
Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...
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