Creating an automation to create a subtask once the ticket is submitted
Asked by Ammar Esmaeel:

Hello all,

I come to you today with a bit of a complex issue

I have a service project that people can submit tickets to from the helpdesk portal

now in the project itself, I have team members from different departments

I need to create a subtask or clone issue automation so the different department members can have their tickets to work on that are identical to the original ticket

now when I made the automation I faced a few issues:

1-the created sub-issues or clones are not associated with any request type

2- the customer can't access the created sub-issue or cloned issues from the portal

so to summarize

once a ticket is submitted it should be duplicated and assigned a request type and give the customer access to it from the portal

is there any way to do this?

Cheers


Answers:
author: Ste Wright
body: Hi [@Ammar Esmaeel](/t5/user/viewprofilepage/user-id/5481066)

There shouldn't be a need to duplicate the ticket; the one submitted should be able to remain as the customer one, accessible via the portal.

You have two options for the creation of the tasks:

1. Create Sub-tasks within the submitted ticket
2. Clone the ticket into tasks, either in the same JSM Project, or into related Jira Projects

\^ Which one works best will depend on your process, but below are some tips for doing this.

---

**(1) Create Sub-tasks**

To do this, you need to ensure Sub-tasks are an available Issue Type in the JSM Project's Issue Type Scheme.

Then, the rule might look like this...

* **Trigger:**Issue created
* **Condition:** Issue fields condition
  * Field = Request Type
  * Condition = equals
  * Value = *\<Request Type here\>*
* **Action:** Create issue
  * Project = Same project
  * Issue type = Sub-task
  * Parent issue = Trigger issue
  * Fields...
    * Summary:
      * *\<Insert Summary here\>*
    * ...etc
* **Action:** Create issue
  * Project = Same project
  * Issue type = Sub-task
  * Parent issue = Trigger issue
  * Fields...
    * Summary:
      * *\<Insert Summary here\>*
* **...etc**

---

**(2) Clone to Tasks**

Again, you will need to ensure Task is either in the JSM Project, or in the Projects you intend to create the tasks in.

Then the rule might look like this...

* **Trigger:**Issue created
* **Condition:** Issue fields condition
  * Field = Request Type
  * Condition = equals
  * Value = *\<Request Type here\>*
* **Action:** Create issue
  * Project = *\<Project here\>*
  * Issue type = Task
  * Fields...
    * Summary:
      * *\<Insert Summary here\>*
      * You could use *{{triggerissue.summary}}* to clone the original ticket's Summary
    * Linked issues:
      * Link = *delivers*
      * Value = Trigger issue
* **Action:** Create issue
  * Project = *\<Project here\>*
  * Issue type = Task
  * Fields...
    * Summary:
      * *\<Insert Summary here\>*
      * You could use *{{triggerissue.summary}}* to clone the original ticket's Summary
    * Linked issues:
      * Link = *delivers*
      * Value = Trigger issue
* **...etc**

---

**Notes:**

* I recommend limiting the rule using a Condition, to relevant tickets created. The Condition above is just an example, as Request Type might not be the relevant factor here.
* You would create a Sub-task or Task per department. You can set different fields as needed - eg. Assignee.
* You can use the Create or Clone Issue Action - it's still possible to set data to be copied from the trigger issue either way.
* You have a few options when setting data in fields...
  * Hard code it into the rule - eg. if it's a certain Assignee each time
  * Copy it from the Trigger issue, to do this on the Action...
    * Select the breadcrumbs next to a field (...)
    * Select "COPY" from the dropdown
    * Set to copy the value from the trigger issue
  * Set it using [smart values](https://support.atlassian.com/cloud-automation/docs/smart-values-in-jira-automation/). You can access field information on the trigger issue using...
    * *{{triggerissue.\<field here\>}}*

*---*

Let us know if this helps - and if you need further assistance, please comment further :)

Ste

comments: author: Ammar Esmaeel
body: thank you so much [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470)

i will try this solution and get back to you

only issue is that I need the customer to access the sub-tasks or clones as well from the portal

Cheers


author: Clara Belin-Brosseau
body: Hello [@Ammar Esmaeel](/t5/user/viewprofilepage/user-id/5481066)

If you're seeking for an easier way to **clone an issue across departments and display it in the portal** , you can try our app [Elements Copy \& Sync](https://marketplace.atlassian.com/apps/1211111/elements-copy-sync-clone-jira-issues?tab=overview&hosting=cloud?&utm_source=community&utm_medium=answer&utm_campaign=question_2729467&utm_keyword=CS&utm_vendorID=4952) that allows you to clone and sync a full hierarchy of issues with all their content (summary, description, custom fields, comments, attachments, etc).

You can check our guide [here](https://doc.elements-apps.com/copy-and-sync-jira-cloud/view-linked-issues-in-the-customer-portal?&utm_source=community&utm_medium=answer&utm_campaign=question_2729467&utm_keyword=CS&utm_vendorID=4952).

You can try the app for free during 30 days (and it stays free under 10 users).

Kind regards,

Clara


Tags: cloud

jira-service-management

jira-service-management-cloud