How to set up PROJECT based on ISSUETYPE when creating an issue?
Asked by do_mi_no:

Can I automatically set PROJECT based on ISSUETYPE?

I started using automation recently. I have created a simple rule that will automatically set SUMMARY when creating a ticket based on ISSUETYPE:  
- When: Issue created  
- If: matches (Issuetype = X)  
- Then: Edit issue fields (Summary = Xyz)  
The above rule works fine.

I would like to set up PROJECT in the same way. I need one specific type of task to always be directed to one specific project (preferably when creating a task).

![2021-09-25 11_12_25-Project automation - JiraEdit.png](/t5/image/serverpage/image-id/162095i9E5FE882277C0515/image-size/large?v=v2&px=999 "2021-09-25 11_12_25-Project automation - JiraEdit.png")

Unfortunately, the PROJECT field is not available for editing (I cannot create a rule analogous to the one described above for SUMMARY).  
If anyone has an idea how to do it, please give me some hints. Thanks.


Answers:
author: Nic Brough -Adaptavist-
body: Project is not a field, it's an entire container for an issue. You can not edit it, you have to physically move an issue from one project to another.

The issue types available to a project are configured at the project level, so there's no way to choose an issue type before you know the project, as the project determines which ones are available.

You can however do "creating "Shopping" issue (no matter what project the user sets), I want to ensure that it goes to the SupplyProject".

Set up SupplyProject to allow the use of the "Shopping" issue type. Do not allow it to be used in any other project. The users won't be able to choose other projects after selecting the Shopping type (well, they will, but they will have to use a different issue type)

comments: author: do_mi_no
body: I guess I'll have to do that. Thanks for the tip.


author: Ravi Sagar _Sparxsys_
body: Hi [@do_mi_no](/t5/user/viewprofilepage/user-id/4081261)

Well Edit issue operation is different from Create issue operation. When you edit an issue, it is already part of a project. This would be a move operation.

So in your rule when you create an issue, you will find a project field.

Is this what you want to achieve with your rule? Move an issue to another project?

Ravi

comments: author: do_mi_no
body: Hi [@Ravi Sagar _Sparxsys_](/t5/user/viewprofilepage/user-id/853596)

To be more precise, I am trying to create an automation rule analogous to the SUMMARY field (described above). That is:

1. When: Issue created.
2. If: matches (Issuetype = Shopping)
3. Then: Edit issue fields (Project = SupplyProject)

I do not want to change previously created issues.

During the process of creating "Shopping" issue (no matter what project the user sets), I want to ensure that it goes to the SupplyProject.

"Edit operation" in this case is the action performed in the third step of the automation rule.


author: Curt Holley
body: Like [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454) says...Project is not a field. and although you could create automation to move them all into the one project...why? When (as [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454) suggests) you can (and should) restrict that issue type to only that project. Thus routing people to it if they want to use it.


author: do_mi_no
body: Users complain about "too many fields to fill", so I wanted to minimize the amount of interactions necessary when creating an issue.  
After selecting issue type, I wanted the project to be selected automatically (specifically thist type of an issue should only be in this project).  
[@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454) 's advice should fix the problem.

[@Ravi Sagar _Sparxsys_](/t5/user/viewprofilepage/user-id/853596) , [@Curt Holley](/t5/user/viewprofilepage/user-id/3527535) - thanks for your advice.


Tags: cloud