Suppose i have two custom fields A and B.
A has values abc
B has value xyz
While creating issue my Lables should be
Labels abc xyz
I tried to create Post Functions and used Copy from one field to another. It worked but what is happening suppose i created two post function one for A and another for B then its taking the last one and not concatenating.
So please suggest which post function should i use in order to get the correct values
Hi @Kamran786 ,
As you have noticed, the Copy from post function will always overwrite what's already in the field and it cannot take input from two fields. You will need an app to achieve this.
I would recommend Cloud Workflows, because I work for that vendor, but there are other options as well. If you go with our app, here's how to set up your post function:
The app allows you to use different fields from your issue when setting the value. If your two custom fields had the ids 10045 and 10044, you would enter this into the value field:
{{ c.issue.fields.customfield_10045 }}, {{ c.issue.fields.customfield_10044 }}
And that's it. Of course, there might already be labels set and those would be overwritten. If you want to keep your current labels and simply add the custom fields, use this as the value:
{{ c.issue.fields.customfield_10045 }}, {{ c.issue.fields.customfield_10044 }}, {{ c.issue.fields.labels }}
Hope that helps,
Oliver
You'll need to use a different post-function.
Copy field works by copying a field. It takes the new data and overwrites the old content.
Labels (amongst others) is a field that holds a list of values (even if there's only one). Your need here is to be adding to that list, not overwriting it with another value. In the background, the code needs to
There are a couple of apps that do provide "add label" or "add to a mulit-value field" that will do it, but I'm not sure you have one that includes one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Step 1: Read the Existing Label data in post function and keep variable
Step 2: Read the Field A and Field B data
Step 3: Merge all these values and assign to label
This i have done - it is working...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you do it via post function. Can you please let me know the steps. Because I have multiple custom fields and then I need to store all of them into Labels. The post function I tried is just overriding
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.