# How to do automation in ShotGrid

**URL:** <https://community.shotgridsoftware.com/t/how-to-do-automation-in-shotgrid/12995>\
**Category:** Uncategorized\
**Created:** [July 21, 2021, 8:12am UTC](https://community.shotgridsoftware.com/t/how-to-do-automation-in-shotgrid/12995 "2021-07-21T08:12:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cha](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@cha](https://community.shotgridsoftware.com/u/cha)\
**Post date:** [July 21, 2021, 8:12am UTC](https://community.shotgridsoftware.com/t/how-to-do-automation-in-shotgrid/12995/1 "2021-07-21T08:12:51Z")

</div>

Hi all ,

I planned to do some automation on ShotGrid .But first , I need to know how to code . Any masters can share some effective ways of learning python to used on ShotGrid ? I tried to follow this step by step , but I don’t even know what is shotgun class .

[![](https://global.discourse-cdn.com/shotgunsoftware/original/2X/8/8e9f11cbeb0c4f77358503cab8626d5d4191c344.jpeg "Shotgun - API Overview") ](https://www.youtube.com/watch?v=QdL5E9XbdJQ)

NEED some guidance here please . Thanks in advanced !

---

<div class="post-metadata">

**Author:** ![mmoshev](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/mmoshev/32/476_2.png) [@mmoshev](https://community.shotgridsoftware.com/u/mmoshev)\
**Post date:** [July 21, 2021, 9:02am UTC](https://community.shotgridsoftware.com/t/how-to-do-automation-in-shotgrid/12995/2 "2021-07-21T09:02:12Z")

</div>

Perhaps the best way is to read the documentation [Shotgun Python API3 — python-api v3.3.0 documentation](https://developer.shotgridsoftware.com/python-api/)  
There are some limited examples there.

If you are only going to be querying and updating information on Shotgun, you will only be using a single object - `Shotgun`. You use its _methods_ (such as `find_one`) to do the work.  
If you have to deal with the filesystem integrations (the Toolkit Core part) it becomes a bit more involved.

It takes time, do not rush it. If you have an idea of what your automation should be doing you are halfway there.

---

<div class="post-metadata">

**Author:** ![cha](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@cha](https://community.shotgridsoftware.com/u/cha)\
**Post date:** [July 21, 2021, 9:25am UTC](https://community.shotgridsoftware.com/t/how-to-do-automation-in-shotgrid/12995/3 "2021-07-21T09:25:50Z")

</div>

@mmoshev ,

Thanks for the tips ! I want automate the status change . For example , after modeling status updated to “done/ final” , texture task status will automatically change from “waiting to start” to “ready to start” .

 ![image](https://global.discourse-cdn.com/shotgunsoftware/original/2X/b/b59fabb641b48ba747193053760b52f4a6f31c23.png)

Does it mean that i imported wrong python class that doesn’t have “find\_one” method ? 😅  
Seems like i do have a lot to catch up

---

<div class="post-metadata">

**Author:** ![mmoshev](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/mmoshev/32/476_2.png) [@mmoshev](https://community.shotgridsoftware.com/u/mmoshev)\
**Post date:** [July 21, 2021, 9:31am UTC](https://community.shotgridsoftware.com/t/how-to-do-automation-in-shotgrid/12995/4 "2021-07-21T09:31:39Z")

</div>

You have an error,  
it should look like this

```auto
from shotgun_api3 import Shotgun
sg = Shotgun("tecdmy...", "test", "rdd...")

```

Note the capital letter on Shotgun, and below  
`Shotgun()` means that you are creating an _instance_ of the class `Shotgun`. It is just like a function call.

---

<div class="post-metadata">

**Author:** ![schicky](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/schicky/32/506_2.png) [@schicky](https://community.shotgridsoftware.com/u/schicky)\
**Post date:** [July 21, 2021, 5:44pm UTC](https://community.shotgridsoftware.com/t/how-to-do-automation-in-shotgrid/12995/5 "2021-07-21T17:44:30Z")

</div>

Take a look at the Event Daemon framework:

> **[ShotGrid Developer](https://developer.shotgridsoftware.com/0d8a11d9/?title=Writing%2BEvent-Driven%2BTriggers)**
>
> This site contains detailed technical reference for all of the ways you can interact with ShotGrid programmatically, as well as tutorials, guides, and other educational resources for learning how to make the best use of all of ShotGrid's integration...

There are example plugins here:

> **[shotgunEvents/src/examplePlugins at master · shotgunsoftware/shotgunEvents](https://github.com/shotgunsoftware/shotgunEvents/tree/master/src/examplePlugins)**
>
> master/src/examplePlugins

Notably, the tasks\_approved.py plugin automates the downstream Task status updating, provided the dependencies between Tasks has been set up.
