Auto change issues type on creation

Hi. I’m working with a third-party QA testing software (TestLodge).
They auto-create an issue any time a task fails, which is great.
I’d like to further improve this by specifying that any issue created by test lodge automatically have the issue type “Bug”.
I’ve tried using a Rule (Project Board → Customize → Rules), but the Rules tool doesn’t appear to have the if… then… logic that I need.
if (created by TestLodge) { issueType = "Bug"}
I’m fine reading docs on how to do this using the API, but I don’t know where to start.
Any help would be greatly appreciated.
Thanks in advance!
(P.S. It does not appear possible to configure TestLodge to do this using their tools. And, yes, I’ve also reached out to their support pplz with the same question.)

Hi @JWalkerPhoneSoap and welcome to the forum,

Before you go spending time writing API code for this, as an initial step I’d recommend confirming that the created_by field will contain the info you’ll need to be able to distinguish whether a task was created by the TestLodge integration or not.

You can do this using the API Explorer. Use one of the Task endpoints to retrieve tasks in the relevant project and check the value of that field.

There’s one catch, which is that created_by is an undocumented field not available in the fields list in the Explorer. But you can get it by including this in the Extra parameters area:
image

The question you’re looking to answer is whether you get a unique user gid in created_by that’s only present for TestLodge-created tasks and no other tasks.

1 Like

Excellent!
So, the created_by for the generated tasks is my user, which is what I’d expect.
I’d assume I can easily work around this by just creating a new TestLodge user, then re-authenticating the integration with that user, then keying off created_by == TestLodge user, yes?

Yes, you got it!

1 Like