JIRA: On Sub Task creation, inherit custom fields from Parent - jira

In JIRA, is there a way when a sub task is created, to have it inherit custom field values from the parent?
For example, we have custom fields called "Epic" and "Feature". If the story has an "Epic" value of "Email" and the "Feature" value of "Stylesheets". When you click the "Create sub task", the sub task should automatically have "Epic" = "Email" and "Feature" = "Stylesheets".
What ways have you done this in the past?
Thanks

I do this two ways:
Use the Create and Link plugin. You can specify which fields will inherit values, alter or append the values, or explicitly set values. This works for both standard and custom field.
Add a post-function to the "Create" step of the subtask's workflow. When the task is created it could check the parent for the values of "Epic" and "Feature" and use those values to populate the subtask. I used the Jira Scripting Suite plugin to write the post-function in Jython.

It would be nice to have a one step way to do this. The best I've found is two steps - clone the issue, which will duplicate all the field values, and then change it to a subtask.

Related

Scheme for custom fields on issue types

I'm wondering if it is possible to create a kinda scheme that is a list of custom fields and apply this scheme to an issue type.
This would cause that issue type to have all custom fields in the list.
I know you have to first associate the field with a screen and also a field configuration. But its this last step 'project and issue type scope' that is confusing me.
The only way I could see how to do this is to go into EACH custom field, then go to the CONTEXTS for that field, then add a new context associating the field and the issue type.
Field configurations and field configuration schemes don't seem to do the trick. It still seems a necessary condition to have your custom field associated with an issue type, but you still need to do that step above, to create a new context for each custom field.
I'm wondering if there is a way to group all the fields in a scheme and associate that scheme once instead of having to do it for EACH FIELD.
Am I missing something? Or it's just not possible?
You're looking for Issue Type Screen Scheme.
First create a default screen with the fields for issue type X. You can also create screens for Create and Edit too if you want
Then define a Screen Scheme for issue type X which says which of those screens to use for that issue type.
Then create an Issue Type Screen Scheme (ITSS) that uses the Screen Scheme for issue type X
It is convoluted but does work. Don't use Field Configurations unless you need to make the field required, and even then it's better to use a Validator on a transition. The only time you need a custom field context is if you have select lists with different sets of options for different projects. If possible, avoid using issue types in custom field contexts.

VSTS - Add a field to a task definition, with a value based on another field

I'd like to add the following functionality to my VSTS extension (plugin).
I have a build task definition which includes a string input. I need to create a new version of my plugin, which adds a new string input to this task.
The new input should be created with a value, which is based on the value of the old field.
For example, if the old field has a value of a/b/c.txt, then the value of the new field should be { path="a/b/c.txt" }.
Is there a way to use node.js or Powershell to achieve this? Another way perhaps?
From my test, it's not able to get the value of a filed from another one. You may try to get the field when the task runs and set value to another field.

TFS 2017 Inherit Values from Parent WIT when creating Child

When linking a child WIT to a parent in TFS I'd like to copy values from the parent into a child WIT Template. If the parent WIT has a title of xyz and I'm linking a child WIT and creating a new template for it, I want to grab the parent values from certain fields, mainly title. I think people deciphered my original request but hopefully this is a little cleaner.
No, it's not supported.
Copy rule only available within the work item itself:
You can use the COPY, DEFAULT, and SERVERDEFAULT elements to
copy a value from one field to another, copy a server value into a
field, or specify a default value to be defined for a field.
Source here: Define a default value or copy a value to a field
Parent/Child just links between work items, but no any relationship eachother accross the value of the fileds.

Creating Managed Lists Like Versions and Components

In JIRA, you can create custom fields which is good, but I feel that their field types are relatively weak.
For example, you can choose the 'Label' which you can add custom labels. That is good, but I need to be able to choose from a list that already exists and do not want users to be able to create new ones freely.
So that leaves us with the option of using a Single Selection List or a Multi-Selection List. The problem with this is the limited way of using it... drop-down. I wish you could populate an item similar to the way you can add a predefined 'Version' or 'Component'. The drop-down feels primitive.
So my question is: Are there a way of changing the selection interface of a list so that it mimics the way you would set a 'Target Version' for example (simply type it in freely and you can remove an item by clicking on the 'X' button).
Or if not, is there a way to create completely separate groups so that they can behave exactly like the 'Version' and the respective 'Version Picker' field.
I want my 'Customer' field to look and behave exactly like my 'Version' fields... not drop-down like.
Versions and Components fields use autocomplete renderer, but
For custom fields of type Multi Select, only the Select List Renderer is available. Furthermore, when modifying a field configuration, you will not be able to configure a Multi Select custom field's renderer.
see this link https://answers.atlassian.com/questions/16669/looking-for-a-custom-field-similar-to-the-component-field

Copying field values when creating a child Workitem in TFS?

We have a TFS team project using the Agile process template.
We have added a string field to the User Story and Task work item types.
This field is a dropdown bound to a global list.
When you create a new linked workitem from an existing workitem (using the NEW button on the LINKS tab for example), the Assigned To, Area and Iteration values are copied to the new linked item.
We would like to also copy the value for the string field that we've added, so that it does not have to be set manually.
Any ideas if this is possible using TFS customization?
It's possible... but not with "out of the box" work item features. You'd need to write some custom code with the SDK (http://archive.msdn.microsoft.com/tfssdk) to get this behavior.

Resources