0
[plugin_jira]
maxuser=
finduser=
endpoint="https://nepallink.atlassian.net/rest/api/latest/user/search?startAt=0&maxResults={maxi}&username={manche}%".format(maxi=maxresult,manche=user_find)

This is my config file , in the endpoints item why I am using the format is so that I can pass a variable to it in my script.The script where it is running is below ,my main.py

maxresult = config.get('plugin_jira', 'maxuser')
user_find = config.get('plugin_jira', 'finduser')
endpoint = config.get('plugin_jira', 'endpoint')

Now what I am confused is when I call the endpoints values in the script it just fetching what is in the config without the variable values that got defined just above it.

How can I make the variable value of maxresult and user_find added to endpoints which is defined to access it.

martineau
  • 119,623
  • 25
  • 170
  • 301
Tara Prasad Gurung
  • 3,422
  • 6
  • 38
  • 76

1 Answers1

0

In your config file, import the variables from main.py as following.

Config file:


from main import maxresult, user_find
[plugin_jira]
endpoint="https://nepallink.atlassian.net/rest/api/latest/user/search?startAt=0&maxResults={maxi}&username={manche}%".format(maxi=maxresult,manche=user_find)

This will allow you to access the required variables to your endpoints.

Hope it helps!

abhinav
  • 1,108
  • 11
  • 23