Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating an Issue by copying values from a field

I am having an issue created with Type 1. When a user edits the issue and clicks the update button, it should copy the values from a specific field called Confirmation(which is a customized field and I am able to get values from it).
As the update button is pressed, it should create another issue of Type 2, and copy the values from the confirmation field to a field called Gaps.  Other values should be copied as well from the issue as well(if possible).

It should then take the values from the Gaps field(which I can get from a sample issue created) and create the sub-tasks for the newly created issue.

What Am I able to do?
I am able to run a script when the update button is pressed, copy values from the Gaps field and the confirmation field.


What I am unable to find?

I am unable to find the script/help to write a script which creates an issue. I am able to find a script that creates sub-fields when a new issue is created but it doesn't demonstrate how to create a new issue. Here is the script that creates a sub-task for a newly created issue.

I am new to Jira. Any help would be really appreciated. Thanks a lot

1 answer

0 votes
John Funk Community Leader Nov 20, 2020

Hi Jamsahaid,

Why don't you just use Automation For Jira to do all of that? You don't need to write scripts or code and it will do all that you need. 

Here is some more information to get you started:

There are two types of automation:

  • Global: In the Free version, you get 100 executions per product, per month
  • Project: In all versions, you get unlimited executions per month

Automation Basics: https://www.atlassian.com/software/jira/guides/expand-jira/automation

You can do this via global rules to apply to all projects also. You'll need to be a Jira Admin/Site Admin, go to Jira Settings > System > Automation Rules (left-hand menu).

For more on using Automation For Jira see these help pages.

Thanks, John
I will dig into it. I am already an Admin so that won't be an issue to me.

Like John Funk likes this

Hi @Jamshaid 

One more automation source for you is the new automation template library, which demonstrates many common use cases:

https://www.atlassian.com/software/jira/automation-template-library#/label/all/1453

Best regards,

Bill

@Bill Sheboy  @John Funk  Could you please guide me about how can I get it working using code? I am not getting the library. Thanks a lot

John Funk Community Leader Nov 23, 2020

You can’t get to the list of rules?

@Bill Sheboy I have been looking into the library you mentioned, but it seems to contradict my requirements. I have to copy data from a single field which can have several new lines and every new line will create a separate sub-task. The field is named Gaps, which means that it will have multiple gaps and every gap will create a new subtask. Can I achieve them in your suggested library? I don't find a way to do that. thanks a lot  

Hi @Jamshaid 

Thank you for clarifying...

Do you know the possible values that could be in the Gaps field (it is a defined list of values), or is it completely dynamic (unknown in advance)?  If it is completely dynamic, I do not know any way to do this with smart values and automation.  There is no generic iterator for looping without the context of an issue list, or list within an issue.

If instead Gaps contains a known list of values...

  1. Let's assume your Gaps field is a string...
  2. Use the If/Else condition and text matching, e.g. indexOf(), to look for a known value
  3. If the value is found, create your sub-task
  4. Else proceed to the next test

Here is the documentation of text and list handling functions to help you:

https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/

https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/

 

__Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

75 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you