Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can Jira notify an admin when a Team Managed project is created?

Mike Clarke
Community Champion
March 16, 2023

Hi all,

Here's a fun one.

A customer of mine has the global permission for Create Team Managed Projects set to everyone (default) and the Jira Admin is frustrated that people are creating TM projects and leaving the Access setting to Open - they also have their own external customers accessing their instance so there's a potential privacy/data breach risk here.

I suggested that they limit the create TM project permission to a defined Group instead of having it open, but Product Ownership of Jira is hazy and no-one wants to make the call.

The admin's preference for now is to somehow be alerted whenever a TM project is created and the Access permission set as Open.

I couldn't figure out how to do this, but my best attempt was an Automation Rule.

I figured that I could use:

Trigger:
When a Project is Created

Condition:
And the user is not in group administrators

Action:
Email (the jira administrator) with the newly created project key at the end of a browse project URL


This way whenever anyone who isn't a Jira Admin who creates a Project (ie a Team Managed Project) the Jira Admin will get an email with an easy link to click.
It'll give them some metrics to work with (e.g. "there were 30 vulnerable projects created last week!!") so over time they can make a data-driven argument about changing the Team Managed permission.

Turns out that the "When a Project is Created" trigger requires a Branch, so I used a JQL query to say that the newly created projectkey didn't match an existing one that I picked out at random.

Problem here is that it found almost 60k issues and throttled on execution.

TM identifier rule.png

Can anyone think of a better way to determine if a Project is a Company Managed Project or a Team Managed Project using JQL?

Similar to this question but the customer isn't currently allowed/authorized to change the Create Team-Managed Projects permission

1 answer

2 votes
Kai Becker
Community Champion
March 17, 2023

Hi @Mike Clarke ,

this is indeed possible, but a little bit of automation magic is needed 😉

When creating a project, you could use the smart value {{project}} and get the id from it via {{project.id}} We can now use this id to query the Jira REST API and get the style (next-gen or classic) of the newly created project.

The rule should look like this (+ your mailing stuff, and checking the response for next-gen)

Screenshot 2023-03-17 at 22.39.49.pngScreenshot 2023-03-17 at 22.39.25.png

It's important, that the REST call needs authorization. Without you will get a "not found" response. 

Mike Clarke
Community Champion
March 19, 2023

Hi @Kai Becker 

Wow this is fantastic! 
I don't usually play with APIs etc so will ask around internally for a bit of help but this looks very promising.  I'll make sure to hit Accept once I've tested this

Thanks! 

Like Kai Becker likes this
Jack Brickey
Community Champion
March 20, 2023

@Kai Becker , cool approach/solution. You might want to turn this into a Community Article.

Like Kai Becker likes this

Suggest an answer

Log in or Sign up to answer