Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I want to create a Custom field and this should give value of two different custom fields

Suraj Shrivastav October 25, 2018

Hello Team,

I would like to request a urgent help !!

I want to create some custom fields but not sure how it will work , I tried to use calculative fields but still no resolution.

Budget left: Budget set - Budget spend

Budget left %: Budget left / budget set

Days left (%): Deadline date  - Created date

Thanks so much

Regards
Suraj

1 answer

0 votes
Deleted user October 25, 2018

@Suraj Shrivastav

May be Script Fields will help you. In the Inline script you can do the required calculation as mentioned above.

Suraj Shrivastav October 25, 2018

So we can't create custom fields for above request..? 

 

Apologies if i am asking wrong ques.

Deleted user October 25, 2018

@Suraj Shrivastav

Here in this example:

Budget left: Budget set - Budget spend

  • You should create 2 number custom fields: Budget set & Budget spend
  • Next create one Script field as : Budget left
    • The script is something like below:

      import com.atlassian.jira.issue.*;
      import com.atlassian.jira.component.ComponentAccessor


      // Get the current issue key
      Issue issueKey = issue
      def id=issueKey.getId()

      // Get access to the Custom Field Manager
      def customFieldManager = ComponentAccessor.getCustomFieldManager();

      // Get the required date field values
      def Budgetset = getCustomFieldValue("Budget set")
      def Budgetspend = getCustomFieldValue("Budget spend")


      def Budgetleft = Budgetset - Budgetspend as Double


      // Display the result on the issue
      return Budgetleft

  • Then add the Script field in the required screen.
Deleted user November 5, 2018

@Suraj Shrivastav

is it helpful ?

Suraj Shrivastav November 10, 2018

Sorry Abhipsa but it didn't worked. I resolved my issue by using correct calculation.

Suggest an answer

Log in or Sign up to answer