Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




BeforeUpdate / IIssueBeforeListener is triggered twice

api

Ive been looking into Countersoft.Gemini.Samples and have noticed that

BeforeUpdate / IIssueBeforeListener is triggered twice.

how to reproduce:

change

    public Issue BeforeCreate(IssueEventArgs args)
    {
        if (args.Entity.GetWatchers().Count == 0) args.Entity.AddWatcher(args.User.Id);
        return args.Entity;
    }

    public Issue BeforeUpdate(IssueEventArgs args)
    {
        return args.Entity;
    }

to

    public Issue BeforeCreate(IssueEventArgs args)
    {
        GeminiApp.LogException(new Exception("BeforeCreate") { Source = "IIssueBeforeListener" }, false);
        return args.Entity;
    }

    public Issue BeforeUpdate(IssueEventArgs args)
    {
        GeminiApp.LogException(new Exception("BeforeUpdate") { Source = "IIssueBeforeListener" }, false);
        return args.Entity;
    }

* - then compile/copy*

* - in plannerview - move an item from "in sprint" to "In progress"*

* - look into system log and "BeforeUpdate IIssueBeforeListener" is listed twice.*

please advice.

Modist
· 1
Modist
Replies (2)
helpful
0
not helpful

Yes, the planner issues the update twice at the moment, we are aware of that.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

combined wth the fact that is never triggered - my guess is that you wrongfully are calling "BeforeUpdate" when in fact You should be calling "BeforeStatusChange".

I will use the following to remedy the situation -

        if (args.Entity.StatusId != args.Previous.StatusId)
        {
            GeminiApp.LogException(new Exception("BeforeUpdate Have changed") { Source = "IIssueBeforeListener" }, false);
        }
        else
        {
            GeminiApp.LogException(new Exception("BeforeUpdate Have not changed") { Source = "IIssueBeforeListener" }, false);
        }

Modist
· 1
Modist