How to update cron_pattern of scheduled bitbucket pipelines using the api?

Flokart Kadriu March 28, 2023

I have created a scheduled pipeline to run every weekday at 08:00 using the bitbucket api, now I want to update that cron pattern in order for that same pipeline to run at 07:00. Even though the response on the PUT request is successful the pipeline is not updated. I am able to update the "enabled" field to true/false but the "cron_pattern" is just ignored.

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 30, 2023

Hello @Flokart Kadriu ,

Welcome to the Community and thanks for reporting this to us.

It seems like you are being affected by an existing bug in that particular endpoint, where the schedule is not updated when trying to change it using the API. A bug ticket was already raised to our development team related to this issue:

I would suggest you to add your vote there, since this helps both developers and product managers to understand the impact. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all bug fixes are implemented with this policy in mind.

While our development team works on fixing that bug, the workaround is to update the schedule directly in the UI.

Thank you, @Flokart Kadriu !

Patrik S

Flokart Kadriu March 30, 2023

Hi @Patrik S

Thank you for the update.

Unfortunately I can't use the UI to update it since there's no way to specify the schedule to be run ONLY on weekdays (MON-FRI).

What I did to solve the issue in my case was:
   1. Deleted the current pipeline schedule
   2. Created a new one using the POST method with the updated cron_pattern.

I hope this is helpful for anyone having the same problem, until the issue is resolved.

Thank you again,
Flokart!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events