# Version Control comment by API

**URL:** <https://community.grafana.com/t/version-control-comment-by-api/1698>\
**Category:** Grafana Plugin Development\
**Tags:** api\
**Created:** [July 7, 2017, 1:32pm UTC](https://community.grafana.com/t/version-control-comment-by-api/1698 "2017-07-07T13:32:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![twbert](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@twbert](https://community.grafana.com/u/twbert)\
**Post date:** [July 7, 2017, 1:32pm UTC](https://community.grafana.com/t/version-control-comment-by-api/1698/1 "2017-07-07T13:32:13Z")

</div>

We use the Grafana API for bulk edits on Dashboards: [http://docs.grafana.org/http\_api/dashboard/](http://docs.grafana.org/http_api/dashboard/)

We write back the changed Dashboard like this:

```python
print (cli.dashboards.db.create(dashboard=tDashboard, overwrite=False))

```

This returns the slug on success, worked fine in Grafana 4.3, and still works in Grafana 4.4.  
However:

1. In the version history, an empty comment is shown. We’d like a descriptive message.
2. The compare functionality fails when comparing to such a comment-less version (even when only the version number has changed, so absolute minimum number of changes - seems like a bug. It just stalls the browser, waited several minutes)

We could not find in the docs how to add a commit message. We tried:

```python
  tDashboard['message']='API Edit by Python script'
  print (cli.dashboards.db.create(dashboard=tDashboard, overwrite=False))

```

But that wasn’t it. Could you advise?

---

<div class="post-metadata">

**Author:** ![daniellee](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/daniellee/32/41_2.png) [@daniellee](https://community.grafana.com/u/daniellee)\
**Post date:** [July 9, 2017, 12:02am UTC](https://community.grafana.com/t/version-control-comment-by-api/1698/2 "2017-07-09T00:02:49Z")

</div>

We missed updating the docs for this (updated now). For this [call](http://docs.grafana.org/http_api/dashboard/#create-update-dashboard) there is now a new parameter, `message` which sets the commit message

> [@twbert](#):
>
> 1. The compare functionality fails when comparing to such a comment-less version (even when only the version number has changed, so absolute minimum number of changes - seems like a bug. It just stalls the browser, waited several minutes)

Can you describe this a bit more. I cannot recreate this.

---

<div class="post-metadata">

**Author:** ![twbert](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@twbert](https://community.grafana.com/u/twbert)\
**Post date:** [July 10, 2017, 8:11am UTC](https://community.grafana.com/t/version-control-comment-by-api/1698/3 "2017-07-10T08:11:44Z")

</div>

Hi Daniel,

Thank you, that was it. You might want to update the example as well in the docs.

```python
print cli.dashboards.db.create(dashboard=tDashboard, overwrite=False, message='API Edit by Python script')

```

About the diff/compare problem:  
Here’s a copy of our grafana.db (all stripped except for one dashboard): [WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free](https://we.tl/7XzMIB94er) , admin/admin, Grafana 4.4.1.  
If I compare for example version 237 to 238, something goes wrong.

**Edit** the Compare does work, it just takes a very long time. It seems to be related to stripped repeatIteration nodes, which are stripped because this is dynamic data and pollutes our normal VCS, and have no effect on the functionality of the Dashboard.

 ![](https://us1.discourse-cdn.com/grafana/original/1X/421f8e48e467ecd3a624140882db9d464f65f90b.PNG)

1. Can you reproduce this?
2. Can the compare performance be improved in this scenario? (Possibly you could do the same as we do; strip the repeatIteration nodes, since it reduces disk usage and improves the comparison UX tremendously)
