Custom actions no longer working
Asked by rougou:

Custom actions are not working properly as of Windows Sourcetree 3.3.4. In particular they don't seem to execute an external .bat script. Nothing happens.

Furthermore, there doesn't seem to be any way to report a bug for the latest versions.

Here is a similar (possibly the same) bug report for a previous version. It's unclear if this bug report is being monitored, so I have posted here.

[https://jira.atlassian.com/browse/SRCTREEWIN-12355?filter=-4\&jql=text%20\~%20%22custom%20action%22%20order%20by%20created%20DESC](https://jira.atlassian.com/browse/SRCTREEWIN-12355?filter=-4&jql=text%20~%20%22custom%20action%22%20order%20by%20created%20DESC)


Answers:
author: rougou
body: Just to follow up, I downloaded and installed the older version 3.2.6, which is still the one linked on the Sourcetree homepage, and now custom actions and terminal are working properly. It seems updates have been disabled as well.

<https://sourcetreeapp.com/?v=win>

It seems the Sourcetree team are phasing the release and I was one of the guinea pigs.

<https://community.atlassian.com/t5/Sourcetree-questions/How-could-I-get-the-3-3-4-version/qaq-p/1237877>

comments: author: dragonfly4
body: Thanks, same problem as I also received the 3.3.4 update


author: algorythmn
body: I've noticed I cannot run Custom Actions also with the 3.3.x releases, still an issue with 3.3.8.

comments: author: Andrew_Cooke
body: I just discovered this does not work too. 3.3.7 here


author: Martin Webb
body: I am also facing this problem in 3.3.6 - My custom actions do not even show up when I right-click on selected files...

comments: author: John Michael Go-Soco
body: I'm on 3.3.6 and have the same problem.

This is a really useful feature. When can we get this fixed, Atlassian?


author: Scott Morgan
body: I just installed on a new system and I can't set up my custom action to diff a commit to the one before it. I don't have "open separate window" checked.

Even putting just git with a param of diff fails. On my older system with an older version of source tree I'm able to use Beyond Compare (via git difftool) to compare a commit with the previous one.

comments: author: Scott Morgan
body: My issue was git.exe wasn't on my system path. Once I added it things started working.


author: Mattias Ahlholm
body: FYI The problem persists in version 3.3.9 but the fix with unchecking "Open in a separate window" still works


author: Miki Watts
body: While the solution above does work, my problem is that I do need a custom action to run in a separate window, since it's a process that does several merges and can pause to let the user correct any merging conflicts.


author: John Michael Go-Soco
body: Posting this here for more visibilty. Source: <https://community.atlassian.com/t5/Sourcetree-questions/Custom-actions-no-longer-working/qaq-p/1219284#M36507>

To make custom actions work, you need to make sure "Open in a separate window" is NOT ticked. This is found in the properties of each custom action you create/edit.


author: Ivo Roes
body: Still issue in 3.3.8 , Atlassian please help!


author: Alexander St. John
body: Still an issue. Version 3.3.7


author: Michael
body: After I installed ver. 3.3.7 few days ago the Custom Actions stopped working, no matter what I did there was nothing, not even an error. After some googling I ended up here and subscribed to this issue to get any update.

I don't know what happened, but yesterday when I tried to create a custom action - it worked! I have no idea what has happened, the version of SourceTree remains the same: 3.3.7.

Here's my action definition:

```
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfCustomAction xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <CustomAction>
        <Caption>Compare Commits</Caption>
        <Target>C:\Program Files\Git\bin\git.exe</Target>
        <Parameters>difftool --dir-diff $SHA</Parameters>
        <OpenInSeparateWindow>false</OpenInSeparateWindow>
        <ShowFullOutput>false</ShowFullOutput>
        <IsSilent>true</IsSilent>
   </CustomAction>
</ArrayOfCustomAction>
```

Here's a GIF showing that it really works.

<https://drive.google.com/file/d/1MT4dL8Wsdqe-0b6t6bGN6n237hYuSr09/view?usp=sharing>

comments: author: wjlin111
body: hi,all,

Yes, It's real!!  
I try it, SourceTree v3.3.8

1. Please don't make "Open in a seperate window" checked.

2. Then restart SourceTree. And try it.

It's worked.

The issue looks like "Open in a seperate window".


author: John Michael Go-Soco
body: Confirmed - I've unticked "Open in a separate window" in each Custom Action and they work!


author: Fedor Gambalev
body: Custom Action doesnt work in SourceTree v3.3.9.  
Same Solution:

1. Don't make "Open in a seperate window" checked.

2. Then restart SourceTree. And try it.


author: Jorge Luque
body: 3.2.6 works, download the archived version from here:

<https://www.sourcetreeapp.com/download-archives>

3.3.8 (latest version as of 04-21-2020) doesn't work.


author: Juraj Petras
body: Same problem here. Custom actions not working anymore.

The notepad custom action below doesn't even show up. The other show but don't work.

SourceTree Version: 3.3.6

My file C:\\Users\\{username}\\AppData\\Local\\Atlassian\\SourceTree\\customactions.xml  
\<?xml version="1.0"?\>  
\<ArrayOfCustomAction xmlns:xsd="<http://www.w3.org/2001/XMLSchema>" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>"\>  
\<CustomAction\>  
\<Caption\>Copy repository path\</Caption\>  
\<Target\>cmd\</Target\>  
\<Parameters\>/C echo $FILE \| clip\</Parameters\>  
\<OpenInSeparateWindow\>false\</OpenInSeparateWindow\>  
\<ShowFullOutput\>true\</ShowFullOutput\>  
\<IsSilent\>true\</IsSilent\>  
\</CustomAction\>  
\<CustomAction\>  
\<Caption\>List branches with the commit\</Caption\>  
\<Target\>C:\\Program Files\\Git\\cmd\\git.exe\</Target\>  
\<Parameters\>branch --all --contains $SHA\</Parameters\>  
\<OpenInSeparateWindow\>false\</OpenInSeparateWindow\>  
\<ShowFullOutput\>true\</ShowFullOutput\>  
\<IsSilent\>true\</IsSilent\>  
\</CustomAction\>  
\<CustomAction\>  
\<Caption\>List tags with the commit\</Caption\>  
\<Target\>C:\\Program Files\\Git\\cmd\\git.exe\</Target\>  
\<Parameters\>tag --contains $SHA\</Parameters\>  
\<OpenInSeparateWindow\>false\</OpenInSeparateWindow\>  
\<ShowFullOutput\>true\</ShowFullOutput\>  
\<IsSilent\>true\</IsSilent\>  
\</CustomAction\>  
\<CustomAction\>  
\<Caption\>Open In notepad++\</Caption\>  
\<Target\>notepad++\</Target\>  
\<Parameters\>$FILE\</Parameters\>  
\<OpenInSeparateWindow\>true\</OpenInSeparateWindow\>  
\<ShowFullOutput\>false\</ShowFullOutput\>  
\<IsSilent\>true\</IsSilent\>  
\</CustomAction\>  
\</ArrayOfCustomAction\>